Browse Source

Merge pull request '组织项目列表返回仓库url' (#221) from yystopf/forgeplus:pm_project_develop into pm_project_develop

pull/347/head
yystopf 2 years ago
parent
commit
a0e34c9ddd
2 changed files with 6 additions and 0 deletions
  1. +5
    -0
      app/models/project.rb
  2. +1
    -0
      app/views/organizations/projects/index.json.jbuilder

+ 5
- 0
app/models/project.rb View File

@@ -485,6 +485,11 @@ class Project < ApplicationRecord
return JSON.parse(cache_result)
end
end

def full_url
Rails.application.config_for(:configuration)['platform_url'] + '/' + self.owner.try(:login) + '/' + self.identifier
end

def to_builder
Jbuilder.new do |project|
project.id self.id


+ 1
- 0
app/views/organizations/projects/index.json.jbuilder View File

@@ -25,4 +25,5 @@ json.projects @projects.each do |project|
json.topics project.project_topics.each do |topic|
json.(topic, :id, :name)
end
json.url project.full_url
end

Loading…
Cancel
Save