Skip to content

Commit bf2deb5

Browse files
authored
Field Region Update completed (#3482)
1 parent 4f1389d commit bf2deb5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/components/field-region/field-region.repository.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,16 @@ export class FieldRegionRepository extends DtoRepository(FieldRegion) {
6767

6868
async update(changes: UpdateFieldRegion) {
6969
const { id, directorId, fieldZoneId, ...simpleChanges } = changes;
70+
await this.updateProperties({ id }, simpleChanges);
7071

71-
if (directorId) {
72-
// TODO update director - lol this was never implemented
72+
if (directorId !== undefined) {
73+
await this.updateRelation('director', 'User', id, directorId);
7374
}
7475

75-
if (fieldZoneId) {
76-
// TODO update field zone - neither was this
76+
if (fieldZoneId !== undefined) {
77+
await this.updateRelation('zone', 'FieldZone', id, fieldZoneId);
7778
}
7879

79-
await this.updateProperties({ id }, simpleChanges);
80-
8180
return await this.readOne(id);
8281
}
8382

0 commit comments

Comments
 (0)