mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
Get relationship attribute renaming working
This commit is contained in:
1 parent
1c76b6d19c
commit
3f13565cf5
2 files changed
+3
-5
No files matched your search
+1
-3
@@ -32,11 +32,8 @@
|
||||
}) as Option;
|
||||
|
||||
async function submit() {
|
||||
console.log(originalKey);
|
||||
|
||||
try {
|
||||
await option.update(databaseId, collectionId, selectedAttribute, originalKey);
|
||||
originalKey = selectedAttribute.key;
|
||||
await invalidate(Dependencies.COLLECTION);
|
||||
if (!$page.url.pathname.includes('attributes')) {
|
||||
await goto(
|
||||
@@ -57,6 +54,7 @@
|
||||
|
||||
$: if (showEdit) {
|
||||
currentAttr ??= { ...selectedAttribute };
|
||||
originalKey = currentAttr.key;
|
||||
error = null;
|
||||
}
|
||||
</script>
|
||||
|
||||
+2
-2
@@ -35,10 +35,11 @@
|
||||
if (!isValueOfStringEnum(RelationMutate, data.onDelete)) {
|
||||
throw new Error(`Invalid on delete: ${data.onDelete}`);
|
||||
}
|
||||
|
||||
await sdk.forProject.databases.updateRelationshipAttribute(
|
||||
databaseId,
|
||||
collectionId,
|
||||
data.key,
|
||||
originalKey,
|
||||
data.onDelete,
|
||||
data.key !== originalKey ? data.key : undefined,
|
||||
);
|
||||
@@ -189,7 +190,6 @@
|
||||
placeholder="Enter Key"
|
||||
bind:value={data.key}
|
||||
autofocus
|
||||
readonly={editing}
|
||||
required />
|
||||
|
||||
<div class="u-flex u-gap-4 u-margin-block-start-8 u-small u-cross-center">
|
||||
|
||||
Reference in new issue
Block a user