修改后端的issue_tag删除问题

dev_forge
sylor_huang@126.com 5 years ago
parent 4a1436248f
commit 64b14e70bd

@ -328,7 +328,8 @@ class ApplicationController < ActionController::Base
def current_user
# User.current
User.find_by_id 1
User.find_by_id 50207
# User.find_by_id 36390
# nil
end

@ -23,12 +23,17 @@ class Gitea::Labels::DeleteService < Gitea::ClientService
end
def render_result(response)
body = JSON.parse(response.body)
return_body = response.body
if return_body.present?
body = JSON.parse(response.body)
else
body = []
end
case response.status
when 204
body
else
{status: -1, message: "#{body['message']}"}
{status: -1, message: "#{body['message'] if body.present?}"}
end
end
end

@ -32,7 +32,8 @@ class Projects::CreateService < ApplicationService
project_language_id: params[:project_language_id],
is_public: get_is_public,
ignore_id: params[:ignore_id],
license_id: params[:license_id]
license_id: params[:license_id],
identifier: params[:repository_name] #新增,hs
}
end

@ -1 +1 @@
json.extract! @project, :id, :name
json.extract! @project, :id, :name,:identifier

@ -0,0 +1,17 @@
class AddValuesToIssueTagsAndTrackers < ActiveRecord::Migration[5.2]
def change
issue_status = %w(新增 正在解决 已解决 反馈 关闭 拒绝)
trackers = %w(缺陷 功能 支持 任务 周报)
issue_status.each_with_index do |s, index|
unless IssueStatus.exists?(name: s)
IssueStatus.create!(name: s, is_closed: (index == 4) , is_default: (index == 0), position: index+1)
end
end
trackers.each_with_index do |s, index|
unless Tracker.exists?(name: s)
Tracker.create!(name: s, is_in_chlog: (index == 0 || index == 1) , is_in_roadmap: (index != 0 || index != 2), position: index+1)
end
end
end
end
Loading…
Cancel
Save