From 2f0c2f8b7ceb3bb4f5dc28acfb5526d912707f93 Mon Sep 17 00:00:00 2001 From: Mathis Date: Thu, 17 Oct 2024 12:15:58 +0200 Subject: [PATCH] Add IWithCount interface to schema.ts Introduced a new interface IWithCount to handle paginated data responses. It includes properties for count, limit, currentOffset, and a generic data type. This change will aid in standardizing pagination across the application. --- apps/backend/src/app/db/schema.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/backend/src/app/db/schema.ts b/apps/backend/src/app/db/schema.ts index 3d9c75e..cc575bd 100644 --- a/apps/backend/src/app/db/schema.ts +++ b/apps/backend/src/app/db/schema.ts @@ -186,4 +186,11 @@ export const FilesTypeForMachine = pgTable("f_type_for_machines", { .notNull() .references(() => FilesTypesTable.id), }); -export type IFilesTypeForMachine = typeof FilesTypeForMachine.$inferSelect \ No newline at end of file +export type IFilesTypeForMachine = typeof FilesTypeForMachine.$inferSelect + +export interface IWithCount { + count: number; + limit: number; + currentOffset: number; + data: T +} \ No newline at end of file