1
0
mirror of https://github.com/TandoorRecipes/recipes.git synced 2026-01-11 00:58:32 -05:00

made ModelEditor setupState function properly handle async requests

This commit is contained in:
vabene1111
2024-10-05 07:51:48 +02:00
parent 4ab0fbf36b
commit e4a6bd0a1f
14 changed files with 54 additions and 57 deletions

View File

@@ -50,11 +50,11 @@ onMounted(() => {
api.apiGroupList().then(r => {
groups.value = r
if (!setupState(props.item, props.itemId)) {
// functions to populate defaults
setupState(props.item, props.itemId, () => {
editingObj.value.validUntil = DateTime.now().plus({month: 1}).toJSDate()
editingObj.value.group = groups.value[0]
}
})
}).catch(err => {
useMessageStore().addError(ErrorMessageType.FETCH_ERROR, err)
})