diff options
Diffstat (limited to 'src-migrate/services')
| -rw-r--r-- | src-migrate/services/auth.ts | 53 | ||||
| -rw-r--r-- | src-migrate/services/banner.ts | 0 | ||||
| -rw-r--r-- | src-migrate/services/pageContent.ts | 14 |
3 files changed, 67 insertions, 0 deletions
diff --git a/src-migrate/services/auth.ts b/src-migrate/services/auth.ts new file mode 100644 index 00000000..a5d02754 --- /dev/null +++ b/src-migrate/services/auth.ts @@ -0,0 +1,53 @@ +import odooApi from '~/common/libs/odooApi'; +import { + RegisterResApiProps, + RegisterProps, + ActivationTokenProps, + ActivationTokenResApiProps, + ActivationOtpProps, + ActivationOtpResApiProps, + ActivationReqProps, + ActivationReqResApiProps, +} from '~/common/types/auth'; + +const BASE_PATH = '/api/v1/user'; + +export const registerUser = async ( + data: RegisterProps +): Promise<RegisterResApiProps> => { + const response = await odooApi('POST', `${BASE_PATH}/register`, data); + + return response; +}; + +export const activationUserToken = async ( + params: ActivationTokenProps +): Promise<ActivationTokenResApiProps> => { + const response = await odooApi( + 'POST', + `${BASE_PATH}/activation-token`, + params + ); + + return response; +}; + +export const activationUserOTP = async ( + params: ActivationOtpProps +): Promise<ActivationOtpResApiProps> => { + const response = await odooApi('POST', `${BASE_PATH}/activation-otp`, params); + + return response; +}; + +export const activationReq = async ( + params: ActivationReqProps +): Promise<ActivationReqResApiProps> => { + const response = await odooApi( + 'POST', + `${BASE_PATH}/activation-request`, + params + ); + + return response; +}; diff --git a/src-migrate/services/banner.ts b/src-migrate/services/banner.ts new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src-migrate/services/banner.ts diff --git a/src-migrate/services/pageContent.ts b/src-migrate/services/pageContent.ts new file mode 100644 index 00000000..24f2c2f0 --- /dev/null +++ b/src-migrate/services/pageContent.ts @@ -0,0 +1,14 @@ +import odooApi from '~/common/libs/odooApi'; + +export const getPageContent = async ({ path }: { path: string }) => { + const params = new URLSearchParams({ + url_path: path, + }); + + const pageContent = await odooApi( + 'GET', + `/api/v1/page-content?${params.toString()}` + ); + + return pageContent; +}; |
