mobiletto-orm-typedef-gen 2.3.28 → 2.3.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -340,31 +340,24 @@
|
|
|
340
340
|
const onAddSubmitted = async (obj: MobilettoOrmObject) => {
|
|
341
341
|
await {{name}}Store
|
|
342
342
|
.create(obj as {{Name}}Type, create{{Name}}ServerErrors);
|
|
343
|
-
addingObject.value = false;
|
|
343
|
+
addingObject.value = false;
|
|
344
344
|
successSnackbar.value = parseMessage(props.msgAddSuccess, messages.value, {
|
|
345
345
|
type: messages.value.typename_{{typeDef.typeName}},
|
|
346
346
|
id: {{Name}}TypeDef.id(obj),
|
|
347
347
|
});
|
|
348
|
-
emit("added", obj);
|
|
348
|
+
emit("added", obj);{{#if typeDef.singleton}}
|
|
349
349
|
return await {{name}}Store.lookup(findSingleton{{Name}}ServerErrors);{{else}}
|
|
350
350
|
return await {{name}}Store.search();{{/if}}
|
|
351
351
|
}
|
|
352
352
|
watch(create{{Name}}ServerErrors, () => {
|
|
353
|
-
if (Object.keys(create{{Name}}ServerErrors).length > 0) {
|
|
353
|
+
if (create{{Name}}ServerErrors.value && Object.keys(create{{Name}}ServerErrors.value).length > 0) {
|
|
354
354
|
errorSnackbar.value = parseMessage(props.msgAddError, messages.value, {
|
|
355
355
|
type: messages.value.typename_{{typeDef.typeName}},
|
|
356
356
|
error: JSON.stringify(create{{Name}}ServerErrors),
|
|
357
357
|
});
|
|
358
358
|
}
|
|
359
|
-
});
|
|
360
|
-
|
|
361
|
-
if (Object.keys(findSingleton{{Name}}ServerErrors).length > 0) {
|
|
362
|
-
errorSnackbar.value = parseMessage(props.msgFindSingletonError, messages.value, {
|
|
363
|
-
type: messages.value.typename_{{typeDef.typeName}},
|
|
364
|
-
error: JSON.stringify(findSingleton{{Name}}ServerErrors),
|
|
365
|
-
});
|
|
366
|
-
}
|
|
367
|
-
});{{/if}}
|
|
359
|
+
});
|
|
360
|
+
|
|
368
361
|
const showAddOrm = () => {
|
|
369
362
|
addingObject.value = true;
|
|
370
363
|
};
|
|
@@ -382,17 +375,17 @@
|
|
|
382
375
|
const onEditSubmitted = async (obj: MobilettoOrmObject) => {
|
|
383
376
|
await {{name}}Store
|
|
384
377
|
.update(obj as {{Name}}Type, edit{{Name}}ServerErrors);
|
|
385
|
-
editingObject.value = {} as {{Name}}Type;{{
|
|
378
|
+
{{#unless typeDef.singleton}}editingObject.value = {} as {{Name}}Type;{{/unless}}
|
|
386
379
|
successSnackbar.value = parseMessage(props.msgEditSuccess, messages.value, {
|
|
387
380
|
type: messages.value.typename_{{typeDef.typeName}},
|
|
388
381
|
id: {{Name}}TypeDef.id(obj),
|
|
389
382
|
});
|
|
390
|
-
emit("edited", obj);
|
|
383
|
+
emit("edited", obj);{{#if typeDef.singleton}}
|
|
391
384
|
return await {{name}}Store.lookup(findSingleton{{Name}}ServerErrors);{{else}}
|
|
392
385
|
return await {{name}}Store.search();{{/if}}
|
|
393
386
|
};
|
|
394
387
|
watch(edit{{Name}}ServerErrors, () => {
|
|
395
|
-
if (Object.keys(edit{{Name}}ServerErrors).length > 0) {
|
|
388
|
+
if (edit{{Name}}ServerErrors.value && Object.keys(edit{{Name}}ServerErrors.value).length > 0) {
|
|
396
389
|
errorSnackbar.value = parseMessage(props.msgEditError, messages.value, {
|
|
397
390
|
type: messages.value.typename_{{typeDef.typeName}},
|
|
398
391
|
id: {{Name}}TypeDef.id(editingObject.value),
|
|
@@ -430,7 +423,7 @@
|
|
|
430
423
|
}
|
|
431
424
|
});
|
|
432
425
|
watch(findSingleton{{Name}}ServerErrors, () => {
|
|
433
|
-
if (Object.keys(findSingleton{{Name}}ServerErrors).length > 0) {
|
|
426
|
+
if (findSingleton{{Name}}ServerErrors.value && Object.keys(findSingleton{{Name}}ServerErrors.value).length > 0) {
|
|
434
427
|
errorSnackbar.value = parseMessage(props.msgFindSingletonError, messages.value, {
|
|
435
428
|
type: messages.value.typename_{{typeDef.typeName}},
|
|
436
429
|
error: JSON.stringify(findSingleton{{Name}}ServerErrors),
|
|
@@ -464,7 +457,7 @@
|
|
|
464
457
|
});
|
|
465
458
|
};
|
|
466
459
|
watch(delete{{Name}}ServerErrors, () => {
|
|
467
|
-
if (Object.keys(delete{{Name}}ServerErrors).length > 0) {
|
|
460
|
+
if (delete{{Name}}ServerErrors.value && Object.keys(delete{{Name}}ServerErrors.value).length > 0) {
|
|
468
461
|
errorSnackbar.value = parseMessage(props.msgDeleteError, messages.value, {
|
|
469
462
|
type: messages.value.typename_{{typeDef.typeName}},
|
|
470
463
|
id: {{Name}}TypeDef.id(obj),
|
|
@@ -340,31 +340,24 @@
|
|
|
340
340
|
const onAddSubmitted = async (obj: MobilettoOrmObject) => {
|
|
341
341
|
await {{name}}Store
|
|
342
342
|
.create(obj as {{Name}}Type, create{{Name}}ServerErrors);
|
|
343
|
-
addingObject.value = false;
|
|
343
|
+
addingObject.value = false;
|
|
344
344
|
successSnackbar.value = parseMessage(props.msgAddSuccess, messages.value, {
|
|
345
345
|
type: messages.value.typename_{{typeDef.typeName}},
|
|
346
346
|
id: {{Name}}TypeDef.id(obj),
|
|
347
347
|
});
|
|
348
|
-
emit("added", obj);
|
|
348
|
+
emit("added", obj);{{#if typeDef.singleton}}
|
|
349
349
|
return await {{name}}Store.lookup(findSingleton{{Name}}ServerErrors);{{else}}
|
|
350
350
|
return await {{name}}Store.search();{{/if}}
|
|
351
351
|
}
|
|
352
352
|
watch(create{{Name}}ServerErrors, () => {
|
|
353
|
-
if (Object.keys(create{{Name}}ServerErrors).length > 0) {
|
|
353
|
+
if (create{{Name}}ServerErrors.value && Object.keys(create{{Name}}ServerErrors.value).length > 0) {
|
|
354
354
|
errorSnackbar.value = parseMessage(props.msgAddError, messages.value, {
|
|
355
355
|
type: messages.value.typename_{{typeDef.typeName}},
|
|
356
356
|
error: JSON.stringify(create{{Name}}ServerErrors),
|
|
357
357
|
});
|
|
358
358
|
}
|
|
359
|
-
});
|
|
360
|
-
|
|
361
|
-
if (Object.keys(findSingleton{{Name}}ServerErrors).length > 0) {
|
|
362
|
-
errorSnackbar.value = parseMessage(props.msgFindSingletonError, messages.value, {
|
|
363
|
-
type: messages.value.typename_{{typeDef.typeName}},
|
|
364
|
-
error: JSON.stringify(findSingleton{{Name}}ServerErrors),
|
|
365
|
-
});
|
|
366
|
-
}
|
|
367
|
-
});{{/if}}
|
|
359
|
+
});
|
|
360
|
+
|
|
368
361
|
const showAddOrm = () => {
|
|
369
362
|
addingObject.value = true;
|
|
370
363
|
};
|
|
@@ -382,17 +375,17 @@
|
|
|
382
375
|
const onEditSubmitted = async (obj: MobilettoOrmObject) => {
|
|
383
376
|
await {{name}}Store
|
|
384
377
|
.update(obj as {{Name}}Type, edit{{Name}}ServerErrors);
|
|
385
|
-
editingObject.value = {} as {{Name}}Type;{{
|
|
378
|
+
{{#unless typeDef.singleton}}editingObject.value = {} as {{Name}}Type;{{/unless}}
|
|
386
379
|
successSnackbar.value = parseMessage(props.msgEditSuccess, messages.value, {
|
|
387
380
|
type: messages.value.typename_{{typeDef.typeName}},
|
|
388
381
|
id: {{Name}}TypeDef.id(obj),
|
|
389
382
|
});
|
|
390
|
-
emit("edited", obj);
|
|
383
|
+
emit("edited", obj);{{#if typeDef.singleton}}
|
|
391
384
|
return await {{name}}Store.lookup(findSingleton{{Name}}ServerErrors);{{else}}
|
|
392
385
|
return await {{name}}Store.search();{{/if}}
|
|
393
386
|
};
|
|
394
387
|
watch(edit{{Name}}ServerErrors, () => {
|
|
395
|
-
if (Object.keys(edit{{Name}}ServerErrors).length > 0) {
|
|
388
|
+
if (edit{{Name}}ServerErrors.value && Object.keys(edit{{Name}}ServerErrors.value).length > 0) {
|
|
396
389
|
errorSnackbar.value = parseMessage(props.msgEditError, messages.value, {
|
|
397
390
|
type: messages.value.typename_{{typeDef.typeName}},
|
|
398
391
|
id: {{Name}}TypeDef.id(editingObject.value),
|
|
@@ -430,7 +423,7 @@
|
|
|
430
423
|
}
|
|
431
424
|
});
|
|
432
425
|
watch(findSingleton{{Name}}ServerErrors, () => {
|
|
433
|
-
if (Object.keys(findSingleton{{Name}}ServerErrors).length > 0) {
|
|
426
|
+
if (findSingleton{{Name}}ServerErrors.value && Object.keys(findSingleton{{Name}}ServerErrors.value).length > 0) {
|
|
434
427
|
errorSnackbar.value = parseMessage(props.msgFindSingletonError, messages.value, {
|
|
435
428
|
type: messages.value.typename_{{typeDef.typeName}},
|
|
436
429
|
error: JSON.stringify(findSingleton{{Name}}ServerErrors),
|
|
@@ -464,7 +457,7 @@
|
|
|
464
457
|
});
|
|
465
458
|
};
|
|
466
459
|
watch(delete{{Name}}ServerErrors, () => {
|
|
467
|
-
if (Object.keys(delete{{Name}}ServerErrors).length > 0) {
|
|
460
|
+
if (delete{{Name}}ServerErrors.value && Object.keys(delete{{Name}}ServerErrors.value).length > 0) {
|
|
468
461
|
errorSnackbar.value = parseMessage(props.msgDeleteError, messages.value, {
|
|
469
462
|
type: messages.value.typename_{{typeDef.typeName}},
|
|
470
463
|
id: {{Name}}TypeDef.id(obj),
|