summaryrefslogtreecommitdiff
path: root/src/lib/auth/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/auth/api')
-rw-r--r--src/lib/auth/api/switchAccountApi.js14
-rw-r--r--src/lib/auth/api/switchAccountProgresApi.js13
2 files changed, 27 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;
diff --git a/src/lib/auth/api/switchAccountProgresApi.js b/src/lib/auth/api/switchAccountProgresApi.js
new file mode 100644
index 00000000..6289a5dd
--- /dev/null
+++ b/src/lib/auth/api/switchAccountProgresApi.js
@@ -0,0 +1,13 @@
+import odooApi from '@/core/api/odooApi';
+import { getAuth } from '@/core/utils/auth';
+
+const switchAccountProgresApi = async () => {
+ const auth = getAuth();
+ const switchAccount = await odooApi(
+ 'GET',
+ `/api/v1/user/${auth.partnerId}/switch_progres`
+ );
+ return switchAccount;
+};
+
+export default switchAccountProgresApi;