From 614d90c43cd8d881ef019128b89c38cdc24f1faf Mon Sep 17 00:00:00 2001 From: Arthur Deierlein Date: Tue, 3 Sep 2024 16:36:26 +0200 Subject: [PATCH] fix(frontend): fetch projects/tasks when customer/project intersect --- frontend/app/analysis/edit/controller.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/app/analysis/edit/controller.js b/frontend/app/analysis/edit/controller.js index e8fe3a2da..f8620bbd3 100644 --- a/frontend/app/analysis/edit/controller.js +++ b/frontend/app/analysis/edit/controller.js @@ -108,8 +108,18 @@ export default class AnalysisEditController extends Controller { yield this.store.pushPayload("report-intersection", res); + const model = this.store.peekRecord("report-intersection", res.data.id); + + if (model.customer) { + this.store.query("project", { customer: model.customer.id }); + } + + if (model.project) { + this.store.query("task", { project: model.project.id }); + } + return { - model: this.store.peekRecord("report-intersection", res.data.id), + model, meta: res.meta, }; }