update
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -37,6 +37,3 @@ yarn-error.log*
|
|||||||
# typescript
|
# typescript
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
next-env.d.ts
|
next-env.d.ts
|
||||||
|
|
||||||
# custom files
|
|
||||||
api.ts
|
|
||||||
41
api.ts
Normal file
41
api.ts
Normal file
@@ -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`,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -134,7 +134,7 @@ export default function ChangeRoleModal({ isOpen, onClose, user, onSuccess }: Ch
|
|||||||
</span>
|
</span>
|
||||||
{isDefault && (
|
{isDefault && (
|
||||||
<span className="text-[10px] text-gray-400 italic">
|
<span className="text-[10px] text-gray-400 italic">
|
||||||
Mặc định không thể xóa
|
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user