From 7cff844e5b62830e991e0a292e2fc5e02ff72050 Mon Sep 17 00:00:00 2001 From: ducanh Date: Sun, 19 Apr 2026 19:18:43 +0700 Subject: [PATCH] update --- .gitignore | 3 -- api.ts | 41 +++++++++++++++++++++++ src/components/tables/ChangeRoleModal.tsx | 2 +- 3 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 api.ts diff --git a/.gitignore b/.gitignore index ae0aa64..794f906 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,3 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts - -# custom files -api.ts \ No newline at end of file diff --git a/api.ts b/api.ts new file mode 100644 index 0000000..5c41924 --- /dev/null +++ b/api.ts @@ -0,0 +1,41 @@ +export const API_URL_ROOT = process.env.NEXT_PUBLIC_API_URL_ROOT || ""; +export const URL_MEDIA = process.env.NEXT_PUBLIC_URL_MEDIA || ""; +export const HOME_URL = process.env.NEXT_PUBLIC_HOME_URL || "http://localhost:3000"; +export const API = { + User : { + CURRENT: `${API_URL_ROOT}/users/current`, + MEDIA: `${API_URL_ROOT}/users/current/media`, + Update: (Id: number | string) => `${API_URL_ROOT}/users/${Id}`, + CHANGE_PASSWORD: (Id: number | string) => `${API_URL_ROOT}/users/${Id}/password`, + APPLICATION: `${API_URL_ROOT}/users/current/application` + }, + Media:{ + PRESIGNED: `${API_URL_ROOT}/media/presigned`, + GET_MEDIA_BY_ID: (Id: number | string) => `${API_URL_ROOT}/media/${Id}`, + }, + Auth : { + LOGOUT: `${API_URL_ROOT}/auth/logout`, + SIGNUP: `${API_URL_ROOT}/auth/signup`, + SIGNIN: `${API_URL_ROOT}/auth/signin`, + CREATEOTP: `${API_URL_ROOT}/auth/token/create`, + VERIFYOTP: `${API_URL_ROOT}/auth/token/verify`, + REFRESH: `${API_URL_ROOT}/auth/refresh`, + GOOGLE_LOGIN: `${API_URL_ROOT}/auth/google/login`, + FORGOT_PASSWORD: `${API_URL_ROOT}/auth/forgot-password`, + }, + Admin:{ + GET_USER_BY_ID: (Id: number | string) => `${API_URL_ROOT}/users/${Id}`, + GET_LIST_USERS: `${API_URL_ROOT}/users`, + CHANGE_ROLE: (Id: number | string) => `${API_URL_ROOT}/users/${Id}/role`, + DELETE_USER: (Id: number | string) => `${API_URL_ROOT}/users/${Id}`, + RESTORE_USER: (Id: number | string) => `${API_URL_ROOT}/users/${Id}/restore`, + GET_USER_MEDIA: (Id: number | string) => `${API_URL_ROOT}/users/${Id}/media`, + GET_ALL_ROLE: `${API_URL_ROOT}/roles`, + UPDATE_APPLICATION_STATUS: (Id: number | string) => `${API_URL_ROOT}/historian/application/${Id}/status` + + }, + Historian:{ + CREATE_CV: `${API_URL_ROOT}/historian/application`, + APPLICATION: `${API_URL_ROOT}/historian/application`, + } +} \ No newline at end of file diff --git a/src/components/tables/ChangeRoleModal.tsx b/src/components/tables/ChangeRoleModal.tsx index 1b101a8..9b37043 100644 --- a/src/components/tables/ChangeRoleModal.tsx +++ b/src/components/tables/ChangeRoleModal.tsx @@ -134,7 +134,7 @@ export default function ChangeRoleModal({ isOpen, onClose, user, onSuccess }: Ch {isDefault && ( - Mặc định không thể xóa + )}