@@ -12,6 +12,7 @@
|
||||
const { supabase } = $derived(data);
|
||||
|
||||
let spaceImgs = $state<FileList>();
|
||||
let uploading = $state(false);
|
||||
let studySpaceData = $state<Omit<Table<"study_spaces">, "id" | "created_at" | "updated_at">>({
|
||||
description: "",
|
||||
building_location: "",
|
||||
@@ -73,7 +74,9 @@
|
||||
<form
|
||||
onsubmit={async (event) => {
|
||||
event.preventDefault();
|
||||
uploading = true;
|
||||
await uploadStudySpace();
|
||||
uploading = false;
|
||||
}}
|
||||
>
|
||||
<Images name="study-space-image" minHeight="16rem" bind:files={spaceImgs} required />
|
||||
@@ -109,7 +112,8 @@
|
||||
disabled={(spaceImgs?.length || 0) === 0 ||
|
||||
!studySpaceData.location ||
|
||||
!studySpaceData.description ||
|
||||
!studySpaceData.building_location}
|
||||
!studySpaceData.building_location ||
|
||||
uploading}
|
||||
>
|
||||
Share this study space!
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user