forked from tangled.org/core
Monorepo for Tangled

appview: db: update GetForksByDid function

Co-Authored-By: oppiliappan <me@oppi.li>
Signed-off-by: Samuel Shuert <me@thecoded.prof>

authored by thecoded.prof oppiliappan and committed by anirudh.fi 7f658363 a0de8e34

Changed files
+8 -5
appview
+8 -5
appview/db/repos.go
··· 466 466 var repos []Repo 467 467 468 468 rows, err := e.Query( 469 - `select did, name, knot, rkey, description, created, source 470 - from repos 471 - where did = ? and source is not null and source != '' 472 - order by created desc`, 473 - did, 469 + `select distinct r.did, r.name, r.knot, r.rkey, r.description, r.created, r.source 470 + from repos r 471 + left join collaborators c on r.at_uri = c.repo_at 472 + where (r.did = ? or c.subject_did = ?) 473 + and r.source is not null 474 + and r.source != '' 475 + order by r.created desc`, 476 + did, did, 474 477 ) 475 478 if err != nil { 476 479 return nil, err