fix: signatures content
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { db } from "./database";
|
||||
import { signaturesTable } from "./schema";
|
||||
import { desc } from "drizzle-orm";
|
||||
|
||||
export const insertSignature = async (
|
||||
signature: typeof signaturesTable.$inferInsert,
|
||||
@ -15,5 +16,8 @@ export const insertSignature = async (
|
||||
export const getSignatures = async (): Promise<
|
||||
Array<typeof signaturesTable.$inferSelect>
|
||||
> => {
|
||||
return db.select().from(signaturesTable);
|
||||
return db
|
||||
.select()
|
||||
.from(signaturesTable)
|
||||
.orderBy(desc(signaturesTable.createdAt));
|
||||
};
|
||||
|
||||
@ -6,7 +6,10 @@ import { ArrowLeft, Users } from "lucide-react";
|
||||
import { usePetitions } from "@/state";
|
||||
|
||||
const Testimonies = () => {
|
||||
const { signatures } = usePetitions();
|
||||
const { signatures: allSignatures } = usePetitions();
|
||||
const signatures = allSignatures.filter(
|
||||
(s) => s.name == null || s.comment == null,
|
||||
);
|
||||
|
||||
const totalCount = signatures.length;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user