@decaf-ts/for-angular 0.0.91 → 0.0.92
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.
|
@@ -5296,7 +5296,10 @@ class NgxModelPageDirective extends NgxPageDirective {
|
|
|
5296
5296
|
* @param {IBaseCustomEvent} event - The event object containing event data and metadata
|
|
5297
5297
|
*/
|
|
5298
5298
|
async handleEvent(event, repository) {
|
|
5299
|
-
const { name, role, handler, data, handlers } = event;
|
|
5299
|
+
const { name, role, handler, data, modelId, handlers } = event;
|
|
5300
|
+
if (!this.modelId && modelId) {
|
|
5301
|
+
this.modelId = modelId;
|
|
5302
|
+
}
|
|
5300
5303
|
if (handler && role) {
|
|
5301
5304
|
this.handlers = handlers || {};
|
|
5302
5305
|
return await handler.bind(this)(event, data || {}, role);
|
|
@@ -5411,8 +5414,9 @@ class NgxModelPageDirective extends NgxPageDirective {
|
|
|
5411
5414
|
this.modelName = modelName = this.model.constructor.name;
|
|
5412
5415
|
}
|
|
5413
5416
|
const getRepository = async (modelName, acc = {}, parent = '') => {
|
|
5414
|
-
if (this._repository)
|
|
5417
|
+
if (this._repository) {
|
|
5415
5418
|
return this._repository;
|
|
5419
|
+
}
|
|
5416
5420
|
const constructor = Model.get(modelName);
|
|
5417
5421
|
if (constructor) {
|
|
5418
5422
|
const properties = this.getModelProperties(constructor);
|
|
@@ -5555,8 +5559,9 @@ class NgxModelPageDirective extends NgxPageDirective {
|
|
|
5555
5559
|
if (data) {
|
|
5556
5560
|
if (!pk)
|
|
5557
5561
|
pk = Model.pk(repository.class);
|
|
5558
|
-
if (!this.modelId)
|
|
5562
|
+
if (!this.modelId) {
|
|
5559
5563
|
this.modelId = data[pk];
|
|
5564
|
+
}
|
|
5560
5565
|
const model = await this.transactionBegin(data, repository, operation);
|
|
5561
5566
|
if (!model) {
|
|
5562
5567
|
return {
|
|
@@ -7985,6 +7990,7 @@ class NgxFormDirective extends NgxParentComponentDirective {
|
|
|
7985
7990
|
role: role || this.operation,
|
|
7986
7991
|
handler: handler,
|
|
7987
7992
|
handlers: this.handlers || {},
|
|
7993
|
+
...(this.operation !== OperationKeys.CREATE ? { modelId: this.modelId } : {}),
|
|
7988
7994
|
});
|
|
7989
7995
|
}
|
|
7990
7996
|
/**
|