From a0775a72bb73bdf150411a9a5ff56a3f3eb7b4d0 Mon Sep 17 00:00:00 2001 From: baha-a Date: Fri, 24 May 2024 15:55:53 +0200 Subject: [PATCH 1/2] Fix problematic argument in SQL query --- DSL/Resql/get-period-times.sql | 4 ++-- DSL/Ruuter/POST/odp/download.yml | 1 + DSL/Ruuter/POST/odp/metrics.yml | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/DSL/Resql/get-period-times.sql b/DSL/Resql/get-period-times.sql index 72b3a409..1c08b812 100644 --- a/DSL/Resql/get-period-times.sql +++ b/DSL/Resql/get-period-times.sql @@ -18,7 +18,7 @@ SELECT WHEN (:period = cmonth) THEN date_trunc(cmonth, NOW() - oneMonth) WHEN (:period = cquarter) THEN date_trunc(cquarter, NOW() - threeMonth) WHEN (:period = cyear) THEN date_trunc(cyear, NOW() - oneYear) - WHEN (:period = cnever) THEN date_trunc(cnever, :start::date) + WHEN (:period = cnever) THEN date_trunc(cday, :start::date) END AS "start", CASE WHEN (:period = cday) THEN date_trunc(cday, NOW()) - oneDay @@ -26,6 +26,6 @@ SELECT WHEN (:period = cmonth) THEN date_trunc(cmonth, NOW()) - oneDay WHEN (:period = cquarter) THEN date_trunc(cquarter, NOW()) - oneDay WHEN (:period = cyear) THEN date_trunc(cyear, NOW()) - oneDay - WHEN (:period = cnever) THEN date_trunc(cnever, :end::date) + WHEN (:period = cnever) THEN date_trunc(cday, :end::date) END AS "end" FROM consts; diff --git a/DSL/Ruuter/POST/odp/download.yml b/DSL/Ruuter/POST/odp/download.yml index ef2344fb..3b6e9b08 100644 --- a/DSL/Ruuter/POST/odp/download.yml +++ b/DSL/Ruuter/POST/odp/download.yml @@ -33,3 +33,4 @@ return: headers: Content-disposition: "attachment;filename=metrics.csv" return: ${metricDataCSV} + status: 200 diff --git a/DSL/Ruuter/POST/odp/metrics.yml b/DSL/Ruuter/POST/odp/metrics.yml index e6d9eb96..8a3ad2be 100644 --- a/DSL/Ruuter/POST/odp/metrics.yml +++ b/DSL/Ruuter/POST/odp/metrics.yml @@ -292,3 +292,4 @@ to_csv: return: return: ${csv} next: end + status: 200 From ea835d36922b1d945874389a8cfbeb37c170438e Mon Sep 17 00:00:00 2001 From: baha-a Date: Fri, 24 May 2024 15:56:42 +0200 Subject: [PATCH 2/2] Refactor handlebars template for array-to-object mapping --- DSL/DMapper/hbs/array-to-object.handlebars | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DSL/DMapper/hbs/array-to-object.handlebars b/DSL/DMapper/hbs/array-to-object.handlebars index b01ae1f8..98de9f9f 100644 --- a/DSL/DMapper/hbs/array-to-object.handlebars +++ b/DSL/DMapper/hbs/array-to-object.handlebars @@ -1,8 +1,8 @@ { -{{#each results as |item i|}} -{{#each item.response.body.[0]}} - "{{lookup @root.fields i}}": "{{this}}", -{{/each}} -{{/each}} - "eof": true + {{#each results as |item i|}} + {{#each item.response.body.[0]}} + "{{lookup @root.fields i}}": "{{this}}"{{#unless @last}},{{/unless}} + {{/each}} + {{#unless @last}},{{/unless}} + {{/each}} }