From aa94b17e698ec93eb5680b488e896733b2627b86 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 18 Jun 2025 19:44:09 +0530 Subject: [PATCH] feat: add notion controller --- .../v1/accounts/integrations/notion_controller.rb | 14 ++++++++++++++ config/routes.rb | 5 +++++ 2 files changed, 19 insertions(+) create mode 100644 app/controllers/api/v1/accounts/integrations/notion_controller.rb 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]