1
0
forked from Yara724/api
Files
yara724-api/src/profile/profile.service.ts

18 lines
589 B
TypeScript

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);
}
}