mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
fix: small fixes to data
This commit is contained in:
1 parent
b6f4f8151d
commit
21807dc2b8
2 files changed
+13
-4
No files matched your search
+2
@@ -138,6 +138,7 @@
|
||||
on:click={() => {
|
||||
relatedList.splice(i, 1);
|
||||
relatedList = relatedList;
|
||||
value = relatedList;
|
||||
}}>
|
||||
<span class="icon-x" aria-hidden="true" />
|
||||
</Button>
|
||||
@@ -212,6 +213,7 @@
|
||||
on:click={() => {
|
||||
relatedList.splice(i, 1);
|
||||
relatedList = relatedList;
|
||||
value = relatedList;
|
||||
}}>
|
||||
<span class="icon-x" aria-hidden="true" />
|
||||
</Button>
|
||||
|
||||
+11
-4
@@ -13,7 +13,7 @@
|
||||
import { collection, type Attributes } from '../../store';
|
||||
import { Container } from '$lib/layout';
|
||||
import AttributeItem from '../attributeItem.svelte';
|
||||
import { difference } from '$lib/helpers/array';
|
||||
import { difference, symmetricDifference } from '$lib/helpers/array';
|
||||
import { isRelationship, isRelationshipToMany } from '../attributes/store';
|
||||
|
||||
const databaseId = $page.params.database;
|
||||
@@ -85,11 +85,18 @@
|
||||
if (
|
||||
isRelationshipToMany(attribute as Models.AttributeRelationship & { side: string })
|
||||
) {
|
||||
const relatedIds = docAttribute.map((doc) => doc.$id);
|
||||
return !difference(workAttribute, relatedIds).length;
|
||||
const workIds = workAttribute.map((doc: string | Record<string, unknown>) =>
|
||||
typeof doc === 'string' ? doc : doc.$id
|
||||
);
|
||||
|
||||
const relatedIds = docAttribute.map((doc: string | Record<string, unknown>) =>
|
||||
typeof doc === 'string' ? doc : doc.$id
|
||||
);
|
||||
return !symmetricDifference(workIds, relatedIds).length;
|
||||
} else {
|
||||
return workAttribute && docAttribute
|
||||
? !difference(Array.from(workAttribute), Array.from(docAttribute)).length
|
||||
? !symmetricDifference(Array.from(workAttribute), Array.from(docAttribute))
|
||||
.length
|
||||
: true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user