more, more, more

This commit is contained in:
2024-11-22 16:16:04 -05:00
parent c0ae295734
commit 4c37b9b248
11 changed files with 69 additions and 8 deletions

View File

@@ -7,15 +7,19 @@ export const getData = async () => {
const data = await db.select().from(brand).orderBy(asc(brand.name));
return data;
};
export const addBrand = async ( name: string) => {
await db.insert(brand).values({
name: name,
});
};
export const deleteBrand = async (id: number) => {
"use server";
await db.delete(brand).where(eq(brand.id, id));
revalidatePath("/");
revalidatePath("/Brands");
};
export const editBrand = async (id: number, name: string) => {
await db
.update(brand)