fix templates api page when new installation

pull/105/head
Alex Turchyn 2 years ago
parent 47c57158f4
commit 130c91178f

@ -10,7 +10,7 @@ module Api
def show def show
render json: @template.as_json(include: { author: { only: %i[id email first_name last_name] }, 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 end
def update def update

@ -90,7 +90,7 @@
</div> </div>
<div class="collapse-content" style="display: inherit"> <div class="collapse-content" style="display: inherit">
<div class="mockup-code overflow-hidden"> <div class="mockup-code overflow-hidden">
<% 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 %> --header 'X-Auth-Token: <%= current_user.access_token.token %>'<% end.to_str %>
<span class="top-0 right-0 absolute"> <span class="top-0 right-0 absolute">
<%= 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' %> <%= 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' %>

Loading…
Cancel
Save