/
opt
/
mawid
/
apps
/
api
/
src
/
clinic
/
/opt/mawid/apps/api/src/clinic
mkdir
upload
Name
Size
Mode
Actions
clinic.controller.ts
731
0644
edit
dl
rm
clinic.module.ts
283
0644
edit
dl
rm
clinic.service.ts
798
0644
edit
dl
rm
Edit:
/opt/mawid/apps/api/src/clinic/clinic.service.ts
(798B)
import { Injectable, NotFoundException } from '@nestjs/common'; import type { UpdateClinicInput } from '@mawid/shared'; import { PrismaService } from '../prisma/prisma.service'; @Injectable() export class ClinicService { constructor(private readonly prisma: PrismaService) {} async get(clinicId: string) { const clinic = await this.prisma.clinic.findUnique({ where: { id: clinicId } }); if (!clinic) throw new NotFoundException('Clinic not found'); return clinic; } async update(clinicId: string, input: UpdateClinicInput) { await this.get(clinicId); // workingHours and settings are replaced wholesale, not deep-merged — // the dashboard always submits the complete object. return this.prisma.clinic.update({ where: { id: clinicId }, data: input }); } }
Save
cmd:
run