diff --git a/app/controllers/api/v1/accounts/integrations/notion_controller.rb b/app/controllers/api/v1/accounts/integrations/notion_controller.rb new file mode 100644 index 000000000..dff6ccece --- /dev/null +++ b/app/controllers/api/v1/accounts/integrations/notion_controller.rb @@ -0,0 +1,14 @@ +class Api::V1::Accounts::Integrations::NotionController < Api::V1::Accounts::BaseController + before_action :fetch_hook, only: [:destroy] + + def destroy + @hook.destroy! + head :ok + end + + private + + def fetch_hook + @hook = Integrations::Hook.where(account: Current.account).find_by(app_id: 'notion') + end +end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 9bab9903d..41ee52f42 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -269,6 +269,11 @@ Rails.application.routes.draw do get :linked_issues end end + resource :notion, controller: 'notion', only: [] do + collection do + delete :destroy + end + end end resources :working_hours, only: [:update]