Download src/modules/shared/sharedCrud.services.ts from bardd/node-pt: direct link, hf CLI and curl.
- Browser
- Download file 747 Bytes
-
https://huggingface.co/spaces/bardd/node-pt/resolve/main/src/modules/shared/sharedCrud.services.ts
- Command line
-
hf download hf://spaces/bardd/node-pt/src/modules/shared/sharedCrud.services.ts
-
curl -L -o sharedCrud.services.ts https://huggingface.co/spaces/bardd/node-pt/resolve/main/src/modules/shared/sharedCrud.services.ts
747 Bytes
| import { Injectable } from '@nestjs/common'; | |
| () | |
| export class sharedCrudService { | |
| private service; | |
| constructor(private serviceObj) { | |
| // super(); | |
| this.service = serviceObj; | |
| } | |
| sharedCreate = (body) => { | |
| return this.service.create(body); | |
| }; | |
| sharedUpdate = (clause, body) => { | |
| return this.service.updateOne(clause, body); | |
| }; | |
| sharedFindOne = (clause) => { | |
| return this.service.findOne(clause); | |
| }; | |
| sharedFindOneAndUpdate = (clause, body, options) => { | |
| return this.service.findOneAndUpdate(clause, body, options); | |
| }; | |
| sharedFind = (clause) => { | |
| return this.service.find(clause); | |
| }; | |
| sharedDelete = (clause) => { | |
| return this.service.deleteOne(clause); | |
| }; | |
| } | |