feat: implement category management API with CRUD operations for categories.
This commit is contained in:
parent
1caeac6226
commit
4b335b6b49
5 changed files with 220 additions and 2 deletions
89
Backend/src/types/categories.type.ts
Normal file
89
Backend/src/types/categories.type.ts
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
export interface Category {
|
||||
id: number;
|
||||
name: {
|
||||
th: string;
|
||||
en: string;
|
||||
};
|
||||
slug: string;
|
||||
description: {
|
||||
th: string;
|
||||
en: string;
|
||||
};
|
||||
icon: string | null;
|
||||
sort_order: number;
|
||||
is_active: boolean;
|
||||
created_at: Date;
|
||||
updated_at: Date | null;
|
||||
}
|
||||
|
||||
export interface listCategoriesResponse {
|
||||
code: number;
|
||||
message: string;
|
||||
data: {
|
||||
categories: Category[];
|
||||
total: number;
|
||||
}
|
||||
}
|
||||
|
||||
export interface createCategory {
|
||||
name: {
|
||||
th: string;
|
||||
en: string;
|
||||
};
|
||||
slug: string;
|
||||
description: {
|
||||
th: string;
|
||||
en: string;
|
||||
};
|
||||
created_by: number;
|
||||
}
|
||||
|
||||
export interface createCategoryResponse {
|
||||
code: number;
|
||||
message: string;
|
||||
data: {
|
||||
id: number;
|
||||
name: {
|
||||
en: string;
|
||||
th: string;
|
||||
};
|
||||
slug: string;
|
||||
description: {
|
||||
en: string;
|
||||
th: string;
|
||||
};
|
||||
created_by: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface updateCategory {
|
||||
id: number;
|
||||
name: {
|
||||
th: string;
|
||||
en: string;
|
||||
};
|
||||
slug: string;
|
||||
description: {
|
||||
th: string;
|
||||
en: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface updateCategoryResponse {
|
||||
id: number;
|
||||
name: {
|
||||
th: string;
|
||||
en: string;
|
||||
};
|
||||
slug: string;
|
||||
description: {
|
||||
th: string;
|
||||
en: string;
|
||||
};
|
||||
updated_by: number;
|
||||
}
|
||||
|
||||
export interface deleteCategoryResponse {
|
||||
code: number;
|
||||
message: string;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue