diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-10-23 17:11:33 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-10-23 17:11:33 +0700 |
| commit | 90710579ba1c12060877f6ec2d26103f9c31058d (patch) | |
| tree | 307032cfb8cd13b790c569bc443258b00b07684e /src-migrate/services | |
| parent | a001da95b9c03167656aec8a573cf60c12164b3f (diff) | |
Refactor and migrate register page
Diffstat (limited to 'src-migrate/services')
| -rw-r--r-- | src-migrate/services/auth.ts | 10 | ||||
| -rw-r--r-- | src-migrate/services/banner.ts | 0 | ||||
| -rw-r--r-- | src-migrate/services/pageContent.ts | 14 |
3 files changed, 24 insertions, 0 deletions
diff --git a/src-migrate/services/auth.ts b/src-migrate/services/auth.ts new file mode 100644 index 00000000..f2fd7761 --- /dev/null +++ b/src-migrate/services/auth.ts @@ -0,0 +1,10 @@ +import odooApi from '~/common/libs/odooApi'; +import { RegisterApiProps, RegisterProps } from '~/common/types/auth'; + +export const registerUser = async ( + data: RegisterProps +): Promise<RegisterApiProps> => { + const response = await odooApi('POST', '/api/v1/user/register', data); + + 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; +}; |
