bugfix: child key not constructed correctly

This commit is contained in:
Michael Shanks 2020-03-26 14:52:44 +00:00
parent 8e322e314b
commit 721569c2d4
1 changed files with 6 additions and 4 deletions

View File

@ -31,12 +31,14 @@
? selectedModel.fields.map(({ name }) => name)
: []
$: currentCollectionKey =
$store.selectedRecord
? joinKey($store.selectedRecord.key, selectedModel.collectionName)
: joinKey(selectedModel.collectionName)
$: editingRecord = editingRecord || record || getNewRecord(selectedModel, currentCollectionKey)
function getCurrentCollectionKey(selectedRecord) {
return selectedRecord
? joinKey(selectedRecord.key, selectedModel.collectionName)
: joinKey(selectedModel.collectionName)
}
$: editingRecord = editingRecord || record || getNewRecord(selectedModel, getCurrentCollectionKey($backendUiStore.selectedRecord))
function closed() {
editingRecord = null