mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-03 05:11:31 -05:00
various improvements for shopping line item dialog
This commit is contained in:
@@ -3,6 +3,7 @@ import {onBeforeMount, ref} from "vue";
|
||||
import {EditorSupportedModels, GenericModel, getGenericModelFromString} from "@/types/Models";
|
||||
import {useI18n} from "vue-i18n";
|
||||
import {ResponseError} from "@/openapi";
|
||||
import {getNestedProperty} from "@/utils/utils";
|
||||
|
||||
// TODO type emit parameter (https://mokkapps.de/vue-tips/emit-event-from-composable)
|
||||
// TODO alternatively there seems to be a getContext method to get the calling context (good practice?)
|
||||
@@ -120,7 +121,8 @@ export function useModelEditorFunctions<T>(modelName: EditorSupportedModels, emi
|
||||
let name = ''
|
||||
if (editingObj.value.id) {
|
||||
modelClass.value.model.toStringKeys.forEach(key => {
|
||||
name += ' ' + key.split('.').reduce((a, b) => a[b], editingObj.value);
|
||||
let value = getNestedProperty(editingObj.value, key)
|
||||
name += ' ' + ((value != null) ? value : '')
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user