From 7879a10a48cf744a6b3ecfe02743d06c0e70d48b Mon Sep 17 00:00:00 2001 From: Don Starwsburg Date: Thu, 21 Nov 2024 15:58:57 -0500 Subject: [PATCH] fixed sort --- src/actions/brandActions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/actions/brandActions.ts b/src/actions/brandActions.ts index 0446835..b10c83b 100644 --- a/src/actions/brandActions.ts +++ b/src/actions/brandActions.ts @@ -1,10 +1,10 @@ "use server"; -import { eq, not } from "drizzle-orm"; +import { eq, not , asc} from "drizzle-orm"; import { revalidatePath } from "next/cache"; import { db } from "../db"; import { brand } from "../db/schema/Brand"; export const getData = async () => { - const data = await db.select().from(brand); + const data = await db.select().from(brand).orderBy(asc(brand.name)); return data; }; export const addBrand = async ( name: string) => {