Skip to content

Commit

Permalink
feat: Add pagination data in the response of the paginated rpc calls
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinszuchet committed Jan 15, 2025
1 parent 3a17608 commit cc7b08d
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions proto/decentraland/social_service_v2/social_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,35 @@ message MutualFriendsPayload {
optional Pagination pagination = 2;
}

message PaginatedResponse {
int32 total = 1;
int32 page = 2;
}

message UsersResponse {
repeated User users = 1;
}

message PaginatedUserResponse {
repeated User users = 1;
PaginatedResponse pagination_data = 2;
}

message FriendshipRequestsResponse {
oneof response {
Requests requests = 1;
InternalServerError internal_server_error = 2;
}
}

message PaginatedFriendshipRequestsResponse {
oneof response {
Requests requests = 1;
InternalServerError internal_server_error = 2;
}
optional PaginatedResponse pagination_data = 3;
}

message UpsertFriendshipResponse {
message Accepted {
string id = 1;
Expand Down Expand Up @@ -161,10 +179,10 @@ service SocialService {

service SocialServiceV2 {
// Get the list of friends for the authenticated user
rpc GetFriends(GetFriendsPayload) returns (stream UsersResponse) {}
rpc GetFriends(GetFriendsPayload) returns (stream PaginatedUserResponse) {}

// Get the list of mutual friends between the authenticated user and the one in the parameter
rpc GetMutualFriends(MutualFriendsPayload) returns (stream UsersResponse) {}
rpc GetMutualFriends(MutualFriendsPayload) returns (stream PaginatedUserResponse) {}

// Get the pending friendship requests for the authenticated user
rpc GetPendingFriendshipRequests(GetFriendshipRequestsPayload) returns (FriendshipRequestsResponse) {}
Expand Down

0 comments on commit cc7b08d

Please sign in to comment.