Download src/modules/user/user.service.ts from bardd/node-pt: direct link, hf CLI and curl.
- Browser
- Download file 697 Bytes
-
https://huggingface.co/spaces/bardd/node-pt/resolve/main/src/modules/user/user.service.ts
- Command line
-
hf download hf://spaces/bardd/node-pt/src/modules/user/user.service.ts
-
curl -L -o user.service.ts https://huggingface.co/spaces/bardd/node-pt/resolve/main/src/modules/user/user.service.ts
697 Bytes
| import { Inject, Injectable } from '@nestjs/common'; | |
| import { Model, Types } from 'mongoose'; | |
| import { USER_REPOSITORY } from 'src/constants'; | |
| import { IUserDocument } from './user.schema'; | |
| import { sharedCrudService } from '../shared/sharedCrud.services'; | |
| interface UserDocument extends IUserDocument { | |
| _id: Types.ObjectId; | |
| } | |
| () | |
| export class UserService extends sharedCrudService { | |
| constructor( | |
| (USER_REPOSITORY) readonly userRepository: Model<IUserDocument>, | |
| ) { | |
| super(userRepository); | |
| } | |
| async getUserData(reqUser: any) { | |
| const user = await this.userRepository.findById({ | |
| _id: reqUser._id, | |
| }); | |
| return user; | |
| } | |
| } | |