feat: friend request notifications

This commit is contained in:
Krispire Admin
2026-06-18 22:45:16 +05:30
parent 9235f68402
commit 5c0581a1da
4 changed files with 46 additions and 10 deletions
+15
View File
@@ -835,6 +835,21 @@ func (h *ProfileHandler) Following(w http.ResponseWriter, r *http.Request) {
response.JSON(w, http.StatusOK, followListResp{Users: users, Total: total})
}
// IncomingFollowRequests — GET /follow-requests?limit=&offset=&q=. The caller's
// pending incoming follow requests (auth required), for the notifications
// "Friend Requests" tab where they're accepted/rejected.
func (h *ProfileHandler) IncomingFollowRequests(w http.ResponseWriter, r *http.Request) {
uid := middleware.UserID(r.Context())
limit, offset := parseLimitOffset(r)
q := strings.TrimSpace(r.URL.Query().Get("q"))
users, total, err := h.graph.IncomingRequests(r.Context(), uid, q, limit, offset)
if err != nil {
mapSocialErr(w, err)
return
}
response.JSON(w, http.StatusOK, followListResp{Users: users, Total: total})
}
// ---------------------------------------------------------------------------
// shared helpers
// ---------------------------------------------------------------------------