Просмотр исходного кода

create PaginateResult interface

kaori 4 лет назад
Родитель
Сommit
01008c8218
1 измененных файлов с 19 добавлено и 0 удалено
  1. 19 0
      packages/app/src/interfaces/in-app-notification.ts

+ 19 - 0
packages/app/src/interfaces/in-app-notification.ts

@@ -9,3 +9,22 @@ export interface IInAppNotification {
   actionUsers: any[] /* Need to set "User[]" as a type" */
   actionUsers: any[] /* Need to set "User[]" as a type" */
   createdAt: string
   createdAt: string
 }
 }
+
+/*
+* Note:
+* Need to use mongoose PaginateResult as a type after upgrading mongoose v6.0.0.
+* Until then, use the original "PagenateResult".
+*/
+export interface PagenateResult<T> {
+  docs: T[];
+  hasNextPage: boolean;
+  hasPrevPage: boolean;
+  limit: number;
+  nextPage: number | null;
+  offset: number;
+  page: number;
+  pagingCounter: number;
+  prevPage: number | null;
+  totalDocs: number;
+  totalPages: number;
+}