diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2023-11-21 06:10:12 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2023-11-21 06:10:12 +0000 |
| commit | 0fc062268c71d53f8777c358b31e2a540d60d404 (patch) | |
| tree | 0183a00dcfb14583c7dfa80da082c21630afe375 /src-migrate/services | |
| parent | 6ebe202147269100cd63ef125e877e8f693a27a1 (diff) | |
| parent | 6a6ce21e5a552b0dc6cd541710a87fd0a0fd9d20 (diff) | |
Merged in refactor/all (pull request #116)
Refactor/all
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; +}; |
