diff --git a/app/controllers/api/templates_controller.rb b/app/controllers/api/templates_controller.rb index de6811a3..dcbb0ee9 100644 --- a/app/controllers/api/templates_controller.rb +++ b/app/controllers/api/templates_controller.rb @@ -10,7 +10,7 @@ module Api def show render json: @template.as_json(include: { author: { only: %i[id email first_name last_name] }, - documents: { only: %i[id filename uuid], methods: %i[url] } }) + documents: { only: %i[id uuid], methods: %i[url filename] } }) end def update diff --git a/app/views/api_settings/index.html.erb b/app/views/api_settings/index.html.erb index a07b6962..4320ecb6 100644 --- a/app/views/api_settings/index.html.erb +++ b/app/views/api_settings/index.html.erb @@ -90,7 +90,7 @@
- <% text = capture do %>curl '<%= api_template_url(current_account.templates.last) %>' \ + <% text = capture do %>curl '<%= api_template_url(current_account.templates&.last || 1) %>' \ --header 'X-Auth-Token: <%= current_user.access_token.token %>'<% end.to_str %> <%= render 'shared/clipboard_copy', icon: 'copy', text:, class: 'btn btn-ghost text-white', icon_class: 'w-6 h-6 text-white', copy_title: 'Copy', copied_title: 'Copied' %>