Skip to content

Commit

Permalink
Merge pull request #41 from gtt-project/next
Browse files Browse the repository at this point in the history
Updates main branch
  • Loading branch information
dkastl authored Jun 11, 2024
2 parents ee8753d + 4509a6a commit 0c14ba5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/subscription_templates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
8 changes: 8 additions & 0 deletions app/views/subscription_templates/unpublish.js.erb
Original file line number Diff line number Diff line change
@@ -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);
Expand Down

0 comments on commit 0c14ba5

Please sign in to comment.