From 752e55686dfee0d536f9e4e128336e91681ba794 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Wed, 11 Sep 2024 17:07:49 +0700 Subject: update switch account --- src/lib/auth/api/switchAccountApi.js | 14 ++++++++++++++ src/lib/auth/api/switchAccountProgresApi.js | 15 +++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 src/lib/auth/api/switchAccountApi.js create mode 100644 src/lib/auth/api/switchAccountProgresApi.js (limited to 'src/lib/auth/api') diff --git a/src/lib/auth/api/switchAccountApi.js b/src/lib/auth/api/switchAccountApi.js new file mode 100644 index 00000000..9b772d20 --- /dev/null +++ b/src/lib/auth/api/switchAccountApi.js @@ -0,0 +1,14 @@ +import odooApi from '@/core/api/odooApi'; +import { getAuth } from '@/core/utils/auth'; + +const switchAccountApi = async ({ data }) => { + const auth = getAuth(); + const switchAccount = await odooApi( + 'PUT', + `/api/v1/user/${auth.partner_id}/switch`, + data + ); + return switchAccount; +}; + +export default switchAccountApi; diff --git a/src/lib/auth/api/switchAccountProgresApi.js b/src/lib/auth/api/switchAccountProgresApi.js new file mode 100644 index 00000000..4005ce3c --- /dev/null +++ b/src/lib/auth/api/switchAccountProgresApi.js @@ -0,0 +1,15 @@ +import odooApi from '@/core/api/odooApi'; +import { getAuth } from '@/core/utils/auth'; + +const switchAccountProgresApi = async () => { + const auth = getAuth(); + console.log('auth', auth); + const switchAccount = await odooApi( + 'PUT', + `/api/v1/user/${auth.partner_id}/switch_progres` + ); + console.log('switchAccount', switchAccount); + return switchAccount; +}; + +export default switchAccountProgresApi; -- cgit v1.2.3