get me api
This commit is contained in:
parent
815e8aeaf0
commit
d8d3dff2e7
8 changed files with 1719 additions and 575 deletions
|
|
@ -2,6 +2,8 @@
|
|||
* Authentication Request/Response Types
|
||||
*/
|
||||
|
||||
import { UserResponse } from './user.types';
|
||||
|
||||
export interface LoginRequest {
|
||||
email: string;
|
||||
password: string;
|
||||
|
|
@ -40,28 +42,6 @@ export interface RefreshTokenResponse {
|
|||
refreshToken: string;
|
||||
}
|
||||
|
||||
export interface UserResponse {
|
||||
id: number;
|
||||
username: string;
|
||||
email: string;
|
||||
role: {
|
||||
code: string;
|
||||
name: {
|
||||
th: string;
|
||||
en: string;
|
||||
};
|
||||
};
|
||||
profile?: {
|
||||
prefix?: {
|
||||
th?: string;
|
||||
en?: string;
|
||||
};
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
avatar_url?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ResetRequest {
|
||||
email: string;
|
||||
|
||||
|
|
|
|||
71
Backend/src/types/user.types.ts
Normal file
71
Backend/src/types/user.types.ts
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
/**
|
||||
* User response type
|
||||
*/
|
||||
export interface UserResponse {
|
||||
id: number;
|
||||
username: string;
|
||||
email: string;
|
||||
updated_at: Date | null;
|
||||
created_at: Date | null;
|
||||
role: {
|
||||
code: string;
|
||||
name: {
|
||||
th: string;
|
||||
en: string;
|
||||
};
|
||||
};
|
||||
profile?: ProfileResponse;
|
||||
}
|
||||
|
||||
export interface ProfileResponse {
|
||||
prefix?: {
|
||||
th?: string;
|
||||
en?: string;
|
||||
};
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
phone: string | null;
|
||||
avatar_url: string | null;
|
||||
birth_date: Date | null;
|
||||
}
|
||||
|
||||
export interface ProfileUpdate {
|
||||
prefix?: {
|
||||
th?: string;
|
||||
en?: string;
|
||||
};
|
||||
first_name?: string;
|
||||
last_name?: string;
|
||||
phone?: string | null;
|
||||
avatar_url?: string | null;
|
||||
birth_date?: Date | null;
|
||||
};
|
||||
|
||||
export interface ProfileUpdateResponse {
|
||||
code: number;
|
||||
message: string;
|
||||
data: {
|
||||
id: number;
|
||||
prefix?: {
|
||||
th?: string;
|
||||
en?: string;
|
||||
};
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
phone: string | null;
|
||||
avatar_url: string | null;
|
||||
birth_date: Date | null;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
export interface ChangePasswordRequest {
|
||||
old_password: string;
|
||||
new_password: string;
|
||||
};
|
||||
|
||||
|
||||
export interface ChangePasswordResponse {
|
||||
code: number;
|
||||
message: string;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue