forked from Yara724/api
Initial commit after migration to gitea
This commit is contained in:
17
src/profile/profile.service.ts
Normal file
17
src/profile/profile.service.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Injectable } from "@nestjs/common";
|
||||
import { UserDbService } from "src/users/entities/db-service/user.db.service";
|
||||
import { ProfileUserRs } from "./dto/user/profile.dto";
|
||||
|
||||
@Injectable()
|
||||
export class ProfileService {
|
||||
constructor(private readonly userDbService: UserDbService) {}
|
||||
|
||||
async getProfileDetail(username: string) {
|
||||
const userDetail = await this.userDbService.findOne({ username });
|
||||
return new ProfileUserRs(userDetail, {});
|
||||
}
|
||||
|
||||
async updateProfile(username: string, update) {
|
||||
return await this.userDbService.findOneAndUpdate({ username }, update);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user