From c2f64adf1786d6247d9b2c9032532225e3779c9e Mon Sep 17 00:00:00 2001 From: yystopf Date: Fri, 17 Nov 2023 09:32:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=E8=BF=94=E5=9B=9E=E4=BB=93?= =?UTF-8?q?=E5=BA=93url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/project.rb | 5 +++++ app/views/organizations/projects/index.json.jbuilder | 1 + 2 files changed, 6 insertions(+) diff --git a/app/models/project.rb b/app/models/project.rb index 5f9fcef68..47db6f775 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -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 diff --git a/app/views/organizations/projects/index.json.jbuilder b/app/views/organizations/projects/index.json.jbuilder index c592932d4..c395732f1 100644 --- a/app/views/organizations/projects/index.json.jbuilder +++ b/app/views/organizations/projects/index.json.jbuilder @@ -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 \ No newline at end of file