feat(databases): allow multiple 1 way relationships btwn collections

Because two way key is not exposed or sent, the API defaults to the
related collection's ID as the two way key. As such, if you try to add
another one, it will fail because the two way key is already in use.
This commit is contained in:
Steven Nguyen committed 2024-05-06 13:17:23 -07:00
1 parent 3881ed4f17
commit 0d502e7045
1 file changed
+2 -2
@@ -1,5 +1,5 @@
<script context="module" lang="ts">
import { Query, type Models, RelationshipType, RelationMutate } from '@appwrite.io/console';
import { ID, Query, type Models, RelationshipType, RelationMutate } from '@appwrite.io/console';
import { sdk } from '$lib/stores/sdk';
export async function submitRelationship(
@@ -21,7 +21,7 @@
data.relationType,
data.twoWay,
data.key,
data.twoWayKey,
data.twoWayKey ?? ID.unique(),
data.onDelete
);
}