From 633965baae9115d75871e8a9806a71cfd07eadd8 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Tue, 25 Apr 2023 09:02:31 -0700 Subject: [PATCH] Ensure Update button is enabled when updating a many relationship The original array was being modified in the relationship component so when the data page checked if work was different than doc, it was always the same. Fixes #5379 --- .../document-[document]/attributes/relationship.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte index c12654564..f01e54ca5 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte @@ -3,12 +3,12 @@ import { PaginationInline } from '$lib/components'; import { SelectSearchItem } from '$lib/elements'; import { Button, InputSelectSearch, Label } from '$lib/elements/forms'; + import { preferences } from '$lib/stores/preferences'; import { sdk } from '$lib/stores/sdk'; import { Query, type Models } from '@appwrite.io/console'; import { onMount } from 'svelte'; import { doc } from '../store'; import { isRelationshipToMany } from './store'; - import { preferences } from '$lib/stores/preferences'; export let id: string; export let label: string; @@ -32,7 +32,7 @@ onMount(async () => { if (value) { if (isRelationshipToMany(attribute)) { - relatedList = value as string[]; + relatedList = (value as string[]).slice(); } else { singleRel = value as string; }