From 7f658363091eb5a1293bed9cc057fd26967b7945 Mon Sep 17 00:00:00 2001 From: Samuel Shuert Date: Tue, 12 Aug 2025 07:58:42 +0000 Subject: [PATCH] appview: db: update GetForksByDid function Co-Authored-By: oppiliappan Signed-off-by: Samuel Shuert --- appview/db/repos.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/appview/db/repos.go b/appview/db/repos.go index dfd0c25b..14ffac38 100644 --- a/appview/db/repos.go +++ b/appview/db/repos.go @@ -466,11 +466,14 @@ func GetForksByDid(e Execer, did string) ([]Repo, error) { var repos []Repo rows, err := e.Query( - `select did, name, knot, rkey, description, created, source - from repos - where did = ? and source is not null and source != '' - order by created desc`, - did, + `select distinct r.did, r.name, r.knot, r.rkey, r.description, r.created, r.source + from repos r + left join collaborators c on r.at_uri = c.repo_at + where (r.did = ? or c.subject_did = ?) + and r.source is not null + and r.source != '' + order by r.created desc`, + did, did, ) if err != nil { return nil, err -- 2.51.2