mirror of
https://gitea.gofwd.group/dstrawsb/ballistic-builder.git
synced 2025-12-06 02:36:44 -05:00
more, more, more
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user