mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-07-13 21:44:32 +08:00
ADD simple project api
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
class ProjectsController < ApplicationController
|
||||
include ApplicationHelper
|
||||
include OperateProjectAbilityAble
|
||||
before_action :require_login, except: %i[index branches group_type_list]
|
||||
include ProjectsHelper
|
||||
before_action :require_login, except: %i[index branches group_type_list simple]
|
||||
before_action :find_project_with_id, only: %i[show branches update destroy fork_users praise_users watch_users]
|
||||
before_action :authorizate_user_can_edit_project!, only: %i[update]
|
||||
before_action :project_public?, only: %i[fork_users praise_users watch_user]
|
||||
@@ -98,6 +99,12 @@ class ProjectsController < ApplicationController
|
||||
@fork_users = paginate(fork_users)
|
||||
end
|
||||
|
||||
def simple
|
||||
project = Project.includes(:owner).select(:id, :name, :identifier, :user_id).find params[:id]
|
||||
|
||||
json_response(project)
|
||||
end
|
||||
|
||||
private
|
||||
def project_params
|
||||
params.permit(:user_id, :name, :description, :repository_name,
|
||||
|
||||
Reference in New Issue
Block a user