fix: project rank include educoder
This commit is contained in:
parent
66d1246a6c
commit
f8a6f62342
|
@ -3,15 +3,26 @@ owner_common = $redis_cache.hgetall("v2-owner-common:#{project_common["owner_id"
|
|||
json.id item[0]
|
||||
json.score item[1]
|
||||
json.name project_common["name"]
|
||||
json.identifier project_common["identifier"]
|
||||
json.description project_common["description"]
|
||||
json.owner do
|
||||
json.id project_common["owner_id"]
|
||||
json.type owner_common["type"]
|
||||
json.name owner_common["name"]
|
||||
json.login owner_common["login"]
|
||||
json.avatar_url owner_common["avatar_url"]
|
||||
if project_common['identifier'].include?("/")
|
||||
json.identifier project_common["identifier"].split('/')[1]
|
||||
json.owner do
|
||||
json.id nil
|
||||
json.type 'User'
|
||||
json.name project_common["identifier"].split('/')[0]
|
||||
json.login project_common["identifier"].split('/')[0]
|
||||
json.avatar_url User::Avatar.get_letter_avatar_url(project_common["identifier"].split('/')[0])
|
||||
end
|
||||
else
|
||||
json.identifier project_common["identifier"]
|
||||
json.owner do
|
||||
json.id project_common["owner_id"]
|
||||
json.type owner_common["type"]
|
||||
json.name owner_common["name"]
|
||||
json.login owner_common["login"]
|
||||
json.avatar_url owner_common["avatar_url"]
|
||||
end
|
||||
end
|
||||
json.description project_common["description"]
|
||||
json.visits project_common["visits"]
|
||||
json.forks project_common["forks"]
|
||||
json.watchers project_common["watchers"]
|
||||
|
|
Loading…
Reference in New Issue