Merge pull request '新增 categroy 和 language 返回' (#214) from KingChan/forgeplus:pm_project_develop into pm_project_develop

This commit is contained in:
KingChan 2023-11-16 14:30:47 +08:00
commit 252b132a4a
1 changed files with 17 additions and 0 deletions

View File

@ -6,4 +6,21 @@ json.projects @projects.each do |project|
json.praised project.praised_by?(current_user)
json.last_update_time render_unix_time(project.updated_on)
json.time_ago time_from_now(project.updated_on)
json.language do
if project.project_language.blank?
json.nil!
else
json.id project.project_language.id
json.name project.project_language.name
end
end
json.category do
if project.project_category.blank?
json.nil!
else
json.id project.project_category.id
json.name project.project_category.name
end
end
end