feat(api): add create and update product routes with authentication
refactor(admin): integrate router refresh after product updates in forms fix(imports): update fetch paths for product creation and update in ReceiptImportClient
This commit is contained in:
@@ -108,8 +108,6 @@ export async function updateProductWithTags(formData: FormData, tags: string[])
|
||||
const text = await tagsRes.text();
|
||||
throw new Error(`Kunde inte uppdatera taggar: ${text}`);
|
||||
}
|
||||
|
||||
revalidatePath('/admin/products');
|
||||
}
|
||||
|
||||
export async function deleteProduct(id: number) {
|
||||
@@ -123,8 +121,6 @@ export async function deleteProduct(id: number) {
|
||||
const text = await res.text();
|
||||
throw new Error(`Kunde inte ta bort produkt: ${text}`);
|
||||
}
|
||||
|
||||
revalidatePath('/admin/products');
|
||||
}
|
||||
|
||||
export async function resetAllProducts() {
|
||||
@@ -155,8 +151,6 @@ export async function bulkSetCategory(ids: number[], categoryId: number | null)
|
||||
const text = await res.text();
|
||||
throw new Error(`Kunde inte uppdatera produkter: ${text}`);
|
||||
}
|
||||
|
||||
revalidatePath('/admin/products');
|
||||
}
|
||||
|
||||
export async function suggestProductCategory(productId: number) {
|
||||
|
||||
Reference in New Issue
Block a user