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