Skip to content

Commit

Permalink
refactor: plugin function types
Browse files Browse the repository at this point in the history
  • Loading branch information
baontq23 committed Mar 22, 2023
1 parent 3c9a806 commit 39104a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/paginate/paginate.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-param-reassign */
import { Schema, Document } from 'mongoose';
import { Schema, Document, Model } from 'mongoose';

export interface QueryResult {
results: Document[];
Expand All @@ -17,7 +17,7 @@ export interface IOptions {
page?: number;
}

const paginate = (schema: Schema) => {
const paginate = <T extends Document, U extends Model<U>>(schema: Schema<T>): void => {
/**
* @typedef {Object} QueryResult
* @property {Document[]} results - Results found
Expand Down

0 comments on commit 39104a9

Please sign in to comment.