Skip to main content

Overview

Returns a function that fetches the paginated list of connection requests the current authenticated user has sent that have not yet been accepted or declined.

Usage Example

import { useFetchSentPendingConnections } from "@replyke/react-js";

function SentRequests() {
  const fetchSentPendingConnections = useFetchSentPendingConnections();
  const [requests, setRequests] = useState([]);

  useEffect(() => {
    fetchSentPendingConnections({ page: 1 }).then((res) => {
      setRequests(res.data);
    });
  }, []);

  return (
    <ul>
      {requests.map(({ id, user }) => (
        <li key={id}>Pending request to {user.name}</li>
      ))}
    </ul>
  );
}

Parameters

The hook returns a function. That function accepts:
page
number
Page number to fetch. Defaults to 1.
limit
number
Number of results per page. Defaults to 20.

Returns

Returns a PaginatedResponse containing pending connection entries:
data
PendingConnection[]
Array of pending connection entries.
pagination
object
Pagination metadata including page, pageSize, totalPages, totalItems, and hasMore.