mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
feat: auto-fill relationship attribute key
This commit is contained in:
1 parent
55c90a033d
commit
9f4beee08f
1 file changed
+8
+8
@@ -123,6 +123,14 @@
|
||||
$: if (data.required || data.array) {
|
||||
data.default = null;
|
||||
}
|
||||
|
||||
$: console.log(data.related);
|
||||
|
||||
$: if (data.related && !data.key) {
|
||||
const collection = collectionList.collections.find((n) => n.$id === data.related);
|
||||
// data key = data related in snake case
|
||||
data.key = collection.name.replace(/\s+/g, '_').toLowerCase();
|
||||
}
|
||||
</script>
|
||||
|
||||
<li>
|
||||
|
||||
Reference in new issue
Block a user