26 lines
694 B
TypeScript
26 lines
694 B
TypeScript
import Database from "@Common/databases/database";
|
|
import BaseRepository from "@Repositories/BaseRepository";
|
|
import { Service } from "typedi";
|
|
import { Documents } from "@prisma/client";
|
|
|
|
@Service()
|
|
export default class DocumentsRepository extends BaseRepository {
|
|
constructor(private database: Database) {
|
|
super();
|
|
}
|
|
protected get model() {
|
|
return this.database.getClient().documents;
|
|
}
|
|
protected get instanceDb() {
|
|
return this.database.getClient();
|
|
}
|
|
|
|
/**
|
|
* @description : Find many users
|
|
*/
|
|
public async findMany(query: any): Promise<Documents[]> {
|
|
query.take = Math.min(query.take || this.defaultFetchRows, this.maxFetchRows);
|
|
return this.model.findMany(query);
|
|
}
|
|
}
|