refactor user accounts structure

This commit is contained in:
2026-03-16 00:33:40 +03:30
parent d2215b9f04
commit 0ad6a3200e
118 changed files with 18774 additions and 8764 deletions
+6 -6
View File
@@ -9,8 +9,8 @@ export class AdminUsersService {
async findAll() {
const [users, count] = await this.prisma.$transaction([
this.prisma.user.findMany(),
this.prisma.user.count(),
this.prisma.admin.findMany(),
this.prisma.admin.count(),
])
return ResponseMapper.paginate(
users.map(user => ({ ...user, fullname: `${user.first_name} ${user.last_name}` })),
@@ -19,7 +19,7 @@ export class AdminUsersService {
}
async findOne(id: string) {
const user = await this.prisma.user.findUnique({
const user = await this.prisma.admin.findUnique({
where: { id },
})
@@ -33,14 +33,14 @@ export class AdminUsersService {
}
async create(data: CreateUserDto) {
return this.prisma.user.create({ data })
return this.prisma.admin.create({ data })
}
async update(id: string, data: UpdateUserDto) {
return this.prisma.user.update({ where: { id }, data })
return this.prisma.admin.update({ where: { id }, data })
}
async delete(id: string) {
return this.prisma.user.delete({ where: { id } })
return this.prisma.admin.delete({ where: { id } })
}
}