handle template archived

This commit is contained in:
Pete Matsyburka committed 2026-06-09 19:49:12 +03:00
1 parent 7784346a97
commit 28f47e1093
3 files changed
+12

No files matched your search

+4
View File
@@ -75,6 +75,10 @@ module Mcp
return { content: [{ type: 'text', text: 'Template not found' }], isError: true } unless template
if template.archived_at?
return { content: [{ type: 'text', text: 'Template has been archived' }], isError: true }
end
current_ability.authorize!(:create, Submission.new(template:, account_id: current_user.account_id))
return { content: [{ type: 'text', text: 'Template has no fields' }], isError: true } if template.fields.blank?