Get relationship attribute renaming working

This commit is contained in:
Bradley Schofield committed 2024-08-22 17:17:25 +09:00
1 parent 1c76b6d19c
commit 3f13565cf5
2 files changed
+3 -5

No files matched your search

@@ -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>
@@ -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">