chore: add comming soon category
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user