FIX 完善 项目标签api

This commit is contained in:
Jasder
2020-05-19 18:34:25 +08:00
parent b02efc3609
commit 5a0b3c8f80
4 changed files with 30 additions and 16 deletions

View File

@@ -2,8 +2,8 @@ class RepositoriesController < ApplicationController
include ApplicationHelper
include OperateProjectAbilityAble
before_action :require_login, only: %i[edit update create_file update_file delete_file sync_mirror]
before_action :find_project, :authorizate!
before_action :find_repository, only: %i[sync_mirror]
before_action :find_project, :authorizate!, except: :tags
before_action :find_repository, only: %i[sync_mirror tags]
before_action :authorizate_user_can_edit_project!, only: %i[sync_mirror]
def show
@@ -49,7 +49,7 @@ class RepositoriesController < ApplicationController
end
def tags
@tags = Gitea::Repository::Tags::ListService.new(@project, @project.identifier).call
@tags = Gitea::Repository::Tags::ListService.new(current_user&.gitea_token, @repo.user.login, @repo.identifier, {page: params[:page], limit: params[:limit]}).call
end
def edit