fix: propagate ticket location to client record on save
This commit is contained in:
@@ -103,6 +103,14 @@ export class TicketService {
|
||||
throw new NotFoundException('Ticket not found');
|
||||
}
|
||||
|
||||
// When saving location, also propagate to the client record
|
||||
if (dto.latitude !== undefined && dto.longitude !== undefined && existing.clientId) {
|
||||
await this.prisma.client.update({
|
||||
where: { id: existing.clientId },
|
||||
data: { latitude: dto.latitude, longitude: dto.longitude },
|
||||
});
|
||||
}
|
||||
|
||||
return this.prisma.ticket.update({
|
||||
where: { id },
|
||||
data: {
|
||||
|
||||
Reference in New Issue
Block a user