feat: friend request notifications
This commit is contained in:
@@ -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
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user