Fix logic errors from mixing up client and server
All checks were successful
/ build (push) Successful in 1m33s
/ deploy (push) Successful in 16s

Fix discard and apiUpdate in Location, Role and Shift sometimes breaking
due to the field and serverField versions of the fields being mixed up.
This commit is contained in:
Hornwitser 2025-06-29 20:39:05 +02:00
parent f79f49b0f6
commit f24dbae5eb

View file

@ -70,7 +70,7 @@ export class ClientScheduleLocation extends ClientEntity<ApiScheduleLocation> {
this.updatedAt = this.serverUpdatedAt;
this.deleted = this.serverDeleted;
this.name = this.serverName;
this.description = this.description;
this.description = this.serverDescription;
}
static create(
@ -457,7 +457,7 @@ export class ClientScheduleRole extends ClientEntity<ApiScheduleRole> {
this.updatedAt = this.serverUpdatedAt;
this.deleted = this.serverDeleted;
this.name = this.serverName;
this.description = this.description;
this.description = this.serverDescription;
}
static create(
@ -613,7 +613,7 @@ export class ClientScheduleShift extends ClientEntity<ApiScheduleShift> {
const wasModified = this.isModified();
this.serverUpdatedAt = DateTime.fromISO(api.updatedAt, opts);
this.serverDeleted = false;
this.roleId = api.roleId;
this.serverRoleId = api.roleId;
this.serverName = api.name;
this.serverDescription = api.description ?? "";
this.serverSlotIds = new Set(api.slots.map(slot => slot.id));