summaryrefslogtreecommitdiff
path: root/src/lib/auth/api/switchAccountApi.js
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-01-22 10:10:19 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-01-22 10:10:19 +0700
commit5cc3c938da3dfde636b918b8f2fdef33f3c61419 (patch)
tree222177fe6dce70fc608698c700de17032105998a /src/lib/auth/api/switchAccountApi.js
parent238c675eecaf6f4f953d87c4b0a128bfa139cff4 (diff)
parent6d9c1067b6e857eb95f12864cc88117350ae6cfb (diff)
Merge branch 'new-release' into CR/form-merchant
# Conflicts: # src/lib/form/components/Merchant.jsx
Diffstat (limited to 'src/lib/auth/api/switchAccountApi.js')
-rw-r--r--src/lib/auth/api/switchAccountApi.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/auth/api/switchAccountApi.js b/src/lib/auth/api/switchAccountApi.js
new file mode 100644
index 00000000..79ca2553
--- /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.partnerId}/switch`,
+ data
+ );
+ return switchAccount;
+};
+
+export default switchAccountApi;