api-server/src/modules/users/users.service.ts

28 lines
783 B
TypeScript
Raw Normal View History

import { Injectable } from '@nestjs/common';
import { UsersRepository } from './users.repository';
@Injectable()
export class UsersService {
constructor(private readonly usersRepository: UsersRepository) {}
async getProfile(userId: string) {
return this.usersRepository.findProfileByUserId(userId);
}
async updateProfile(userId: string, dto: any) {
return this.usersRepository.updateProfile(userId, dto);
}
async getProfileDetail(userId: string) {
return this.usersRepository.findUserProfile(userId);
}
async updateProfileDetail(userId: string, dto: any) {
return this.usersRepository.upsertUserProfile(userId, dto);
}
async updatePreferences(userId: string, dto: any) {
return this.usersRepository.updatePreferences(userId, dto);
}
}