From 69bd18184aeaddd7ecbac9f59902ab2cadfa513e Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Mon, 5 Jan 2026 17:34:00 +0800 Subject: [PATCH] Separated functions --- src/routes.tsx | 3 +-- src/utils/functions/index.ts | 2 ++ src/utils/functions/saveNewName.ts | 8 ++++++++ src/utils/functions/saveNewPassword.ts | 8 ++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 src/utils/functions/saveNewName.ts create mode 100644 src/utils/functions/saveNewPassword.ts diff --git a/src/routes.tsx b/src/routes.tsx index 9e31688..cc82072 100644 --- a/src/routes.tsx +++ b/src/routes.tsx @@ -1,7 +1,6 @@ -import { lazy } from 'solid-js' import type { RouteDefinition } from '@solidjs/router' - import Index from './pages/IndexPage/Index' +import { lazy } from 'solid-js' export const routes: RouteDefinition[] = [ { diff --git a/src/utils/functions/index.ts b/src/utils/functions/index.ts index c9862ca..114d5b2 100644 --- a/src/utils/functions/index.ts +++ b/src/utils/functions/index.ts @@ -7,3 +7,5 @@ export { default as postApi } from './postApi.ts'; export { default as statusPopsApi } from './statusPopsApi.ts'; export { default as voidPopsApi } from './voidPopsApi.ts'; export { default as securePassword } from './securePassword.ts'; +export { default as saveNewName } from './saveNewName.ts'; +export { default as saveNewPassword } from './saveNewPassword.ts'; diff --git a/src/utils/functions/saveNewName.ts b/src/utils/functions/saveNewName.ts new file mode 100644 index 0000000..7a0d982 --- /dev/null +++ b/src/utils/functions/saveNewName.ts @@ -0,0 +1,8 @@ +import { postApi } from './index.ts' + +export default async(id: number, name: string) => { + await postApi('update-name', { + data: id, + data2: name + }) + } \ No newline at end of file diff --git a/src/utils/functions/saveNewPassword.ts b/src/utils/functions/saveNewPassword.ts new file mode 100644 index 0000000..058b0b5 --- /dev/null +++ b/src/utils/functions/saveNewPassword.ts @@ -0,0 +1,8 @@ +import { postApi } from './index.ts' + +export default async(id: number, password: string) => { + await postApi('update-password', { + data: id, + data2: password + }) + } \ No newline at end of file