feat(doctor): implement Doctors / Vets CRUD backend and DB model (TASK-2.18)
This commit is contained in:
1 parent
d784f3fcc7
commit
47bff2c6ed
4 files changed
+63
-1
No files matched your search
@@ -429,4 +429,22 @@ export class AdminService {
|
||||
await this.prisma.$transaction(operations);
|
||||
return this.getSettings();
|
||||
}
|
||||
|
||||
async getDoctors() {
|
||||
return this.prisma.doctor.findMany({
|
||||
orderBy: { createdAt: 'desc' },
|
||||
});
|
||||
}
|
||||
|
||||
async createDoctor(data: { name: string; title: string; avatarUrl?: string; bio?: string; clinic?: string }) {
|
||||
return this.prisma.doctor.create({ data });
|
||||
}
|
||||
|
||||
async updateDoctor(id: string, data: { name?: string; title?: string; avatarUrl?: string; bio?: string; clinic?: string }) {
|
||||
return this.prisma.doctor.update({ where: { id }, data });
|
||||
}
|
||||
|
||||
async deleteDoctor(id: string) {
|
||||
return this.prisma.doctor.delete({ where: { id } });
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user