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
This commit is contained in:
Steven Nguyen
2023-04-25 09:02:31 -07:00
parent d4bf96c942
commit 633965baae
@@ -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;
}