Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
fix(web): allow updating syndici
Browse files Browse the repository at this point in the history
  • Loading branch information
jenspots committed May 21, 2023
1 parent 246fc09 commit 5ef51a1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
19 changes: 14 additions & 5 deletions web/src/views/building/BuildingMaker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ const submit = () => {
for (const fileId of fileIds.value) {
const element: any = document.getElementById(fileId);
console.log(element.files.length);
if (element.files.length > 0) {
await new BuildingQuery().createImage(newBuilding, fileId);
}
Expand All @@ -429,12 +428,22 @@ const submit = () => {
}
// Create address
console.log(formattedAddress);
const newAddress = await new AddressQuery().updateOne({
...{ id: address_id.value },
...formattedAddress,
});
console.log(newAddress);
let syndicus = (
await new SyndicusQuery().getAll({
user: buildingUnwrapped.syndicus.id,
})
).pop();
if (!syndicus) {
syndicus = await new SyndicusQuery().createOne({
user_id: buildingUnwrapped.syndicus.id,
});
}
const newBuilding = await new BuildingQuery().updateOne({
id: buildingId.value,
Expand All @@ -444,11 +453,11 @@ const submit = () => {
ivago_id: buildingUnwrapped.ivago_id,
expected_time: buildingUnwrapped.expectedTimeInHours * 60,
manual_id: building.value.manual_id,
syndicus_id: syndicus.id,
});
await router.push(`/gebouw/${newBuilding.id}`);
}
// Redirect
});
};
Expand Down
4 changes: 3 additions & 1 deletion web/src/views/student/SchedulingScreenStudents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@
variant="text"
size="compact"
>
{{ new Date(item.schedule.day).toLocaleTimeString().slice(0,5) }}
{{
new Date(item.schedule.day).toLocaleTimeString().slice(0, 5)
}}
</v-chip>
<v-chip label color="primary" class="mr-2">
<v-icon
Expand Down

0 comments on commit 5ef51a1

Please sign in to comment.