chore: add comming soon category

This commit is contained in:
2026-03-07 17:59:34 +01:00
parent 0eb775f3ef
commit ab7d8929a8
4 changed files with 81 additions and 6 deletions
+5 -2
View File
@@ -591,6 +591,7 @@ export interface Category {
id: number;
name: string;
color: string;
is_coming_soon: boolean;
created_at: string;
}
@@ -606,11 +607,12 @@ export const getCategories = async (): Promise<Category[]> => {
export const createCategoryAdmin = async (
name: string,
color: string,
isComingSoon: boolean = false,
): Promise<{ success: boolean; category?: Category; error?: string }> => {
try {
const { data } = await apiClient.post(
`${V2}/admin/protected/categories`,
{ name, color },
{ name, color, is_coming_soon: isComingSoon },
);
return { success: true, category: data.category };
} catch (error: any) {
@@ -625,11 +627,12 @@ export const updateCategoryAdmin = async (
id: number,
name: string,
color: string,
isComingSoon: boolean = false,
): Promise<{ success: boolean; category?: Category; error?: string }> => {
try {
const { data } = await apiClient.put(
`${V2}/admin/protected/categories/${id}`,
{ name, color },
{ name, color, is_coming_soon: isComingSoon },
);
return { success: true, category: data.category };
} catch (error: any) {