File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ type GitPatchRequest interface {
38
38
GetPatchRequestByID (prID int64 ) (* PatchRequest , error )
39
39
GetPatchRequests () ([]* PatchRequest , error )
40
40
GetPatchRequestsByRepoID (repoID int64 ) ([]* PatchRequest , error )
41
+ GetPatchRequestsByPubkey (pubkey string ) ([]* PatchRequest , error )
41
42
GetPatchsetsByPrID (prID int64 ) ([]* Patchset , error )
42
43
GetPatchsetByID (patchsetID int64 ) (* Patchset , error )
43
44
GetLatestPatchsetByPrID (prID int64 ) (* Patchset , error )
@@ -271,6 +272,16 @@ func (cmd PrCmd) GetPatchRequestsByRepoID(repoID int64) ([]*PatchRequest, error)
271
272
return prs , err
272
273
}
273
274
275
+ func (cmd PrCmd ) GetPatchRequestsByPubkey (pubkey string ) ([]* PatchRequest , error ) {
276
+ prs := []* PatchRequest {}
277
+ err := cmd .Backend .DB .Select (
278
+ & prs ,
279
+ "SELECT pr.* FROM patch_requests pr, app_users au WHERE pr.user_id=au.id AND au.pubkey=? ORDER BY id DESC" ,
280
+ pubkey ,
281
+ )
282
+ return prs , err
283
+ }
284
+
274
285
func (cmd PrCmd ) GetPatchRequestByID (prID int64 ) (* PatchRequest , error ) {
275
286
pr := PatchRequest {}
276
287
err := cmd .Backend .DB .Get (
Original file line number Diff line number Diff line change @@ -390,7 +390,7 @@ func userDetailHandler(w http.ResponseWriter, r *http.Request) {
390
390
}
391
391
isAdmin := web .Backend .IsAdmin (pk )
392
392
393
- prs , err := web .Pr .GetPatchRequests ( )
393
+ prs , err := web .Pr .GetPatchRequestsByPubkey ( user . Pubkey )
394
394
if err != nil {
395
395
web .Logger .Error ("cannot get prs" , "err" , err )
396
396
w .WriteHeader (http .StatusInternalServerError )
You can’t perform that action at this time.
0 commit comments