Skip to content

Commit

Permalink
Merge pull request #53 from gtt-project/next
Browse files Browse the repository at this point in the history
Fixes broker_url issue
  • Loading branch information
dkastl authored Nov 7, 2024
2 parents d6e2142 + abbca7c commit 36ae624
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions app/controllers/subscription_templates_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'net/http'
require 'uri'

class SubscriptionTemplatesController < ApplicationController
layout 'base'
Expand Down Expand Up @@ -90,7 +91,8 @@ def publish
end

def unpublish
@broker_url = URI.join(@subscription_template.broker_url, "/v2/subscriptions/", @subscription_template.subscription_id).to_s
broker_url = URI(@subscription_template.broker_url)
@broker_url = broker_url.merge("/v2/subscriptions/#{@subscription_template.subscription_id}").to_s
handle_publish_unpublish('unpublish', l(:subscription_unpublished), 'unpublish.js.erb')
end

Expand Down Expand Up @@ -123,8 +125,9 @@ def render_subscription_templates(message)
end

def prepare_payload
@broker_url = URI.join(@subscription_template.broker_url, "/v2/subscriptions").to_s
@entity_url = URI.join(@subscription_template.broker_url, "/v2/entities").to_s
broker_url = URI(@subscription_template.broker_url)
@broker_url = broker_url.merge("v2/subscriptions").to_s
@entity_url = broker_url.merge("v2/entities").to_s
@member = Member.find(@subscription_template.member_id)

http_custom = {
Expand Down
2 changes: 1 addition & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
author_url 'https://github.com/georepublic'
url 'https://github.com/gtt-project/redmine_gtt_fiware'
description 'Adds FIWARE integration capabilities for GTT projects'
version '1.0.5'
version '1.0.6'

# Specify the minimum required Redmine version
requires_redmine :version_or_higher => '5.0.0'
Expand Down

0 comments on commit 36ae624

Please sign in to comment.