From d727e08d3e91bff474b9a310552fd457ced85152 Mon Sep 17 00:00:00 2001 From: "Amy J. Ko" Date: Tue, 30 Jul 2024 18:45:17 -0700 Subject: [PATCH] Fixed supervision setting. --- CHANGELOG | 1 + src/database/OrganizationsDB.ts | 4 ++-- src/routes/org/[orgid]/people/+page.svelte | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 0dd6200..b4a9ee6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -13,6 +13,7 @@ Dates should be in`YYYY-MM-DD` format and versions are in [semantic versioning]( - Fixed form submission. - Fixed position of dialogs. +- Fixed supervision setting. ## v0.6.2 2024-07-28 diff --git a/src/database/OrganizationsDB.ts b/src/database/OrganizationsDB.ts index a6ca22c..27a0930 100644 --- a/src/database/OrganizationsDB.ts +++ b/src/database/OrganizationsDB.ts @@ -525,13 +525,13 @@ class OrganizationsDB { async updateProfileSupervisor( orgid: OrganizationID, profileid: ProfileID, - supervisor: PersonID | null + supervisor: ProfileID | null ) { const { error } = await this.supabase .from('profiles') .update({ supervisor }) .eq('orgid', orgid) - .eq('personid', profileid); + .eq('id', profileid); return error; } diff --git a/src/routes/org/[orgid]/people/+page.svelte b/src/routes/org/[orgid]/people/+page.svelte index ceb7cce..a359a1b 100644 --- a/src/routes/org/[orgid]/people/+page.svelte +++ b/src/routes/org/[orgid]/people/+page.svelte @@ -156,10 +156,10 @@ }) ]} selection={profile.supervisor ?? undefined} - change={(personID) => { + change={(profileID) => { queryOrError( errors, - $db.updateProfileSupervisor($organization.getID(), profile.id, personID ?? null), + $db.updateProfileSupervisor($organization.getID(), profile.id, profileID ?? null), "Couldn't update supervisor." ); }}