From f8e44f501aeac70053325b80720572ad0692a9ed Mon Sep 17 00:00:00 2001 From: Daniel Kastl Date: Tue, 11 Jun 2024 17:10:43 +0900 Subject: [PATCH 1/2] Tenant not supported for unpublish Fixes #38 Signed-off-by: Daniel Kastl --- app/views/subscription_templates/unpublish.js.erb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/views/subscription_templates/unpublish.js.erb b/app/views/subscription_templates/unpublish.js.erb index d68516f..e23a031 100644 --- a/app/views/subscription_templates/unpublish.js.erb +++ b/app/views/subscription_templates/unpublish.js.erb @@ -1,6 +1,14 @@ // Build the request headers var headers = new Headers(); +<% if @subscription_template.fiware_service.present? %> + headers.append('Fiware-Service', '<%= @subscription_template.fiware_service %>'); +<% end %> + +<% if @subscription_template.fiware_servicepath.present? %> + headers.append('Fiware-ServicePath', '<%= @subscription_template.fiware_servicepath %>'); +<% end %> + var authToken = document.getElementById('subscription_auth_token').value; if (authToken) { headers.append('Authorization', 'Bearer ' + authToken); From afddd5392b946a1c1c0701494ecd7a880b6190df Mon Sep 17 00:00:00 2001 From: Daniel Kastl Date: Tue, 11 Jun 2024 17:20:15 +0900 Subject: [PATCH 2/2] Empty new line in "description" and "note" field causes error due to invalid JSON Fixes #36 Signed-off-by: Daniel Kastl --- app/controllers/subscription_templates_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/subscription_templates_controller.rb b/app/controllers/subscription_templates_controller.rb index 76c8ea9..b0b036b 100644 --- a/app/controllers/subscription_templates_controller.rb +++ b/app/controllers/subscription_templates_controller.rb @@ -137,10 +137,10 @@ def prepare_payload method: "POST", json: { entity: "#{@entity_url}/${id}?type=${type}", - subject: @subscription_template.subject, - description: @subscription_template.description, + subject: @subscription_template.subject.chomp, + description: @subscription_template.description.chomp, attachments: @subscription_template.attachments, - notes: @subscription_template.notes, + notes: @subscription_template.notes.chomp, geometry: @subscription_template.geometry } }