Add request to response when canceling request

This commit is contained in:
Andrea Maria Piana 2023-02-07 18:22:49 +00:00
parent 7123b22c52
commit 5d81866957
5 changed files with 8 additions and 3 deletions

View File

@ -1 +1 @@
0.138.0
0.138.1

View File

@ -1042,6 +1042,7 @@ func (m *Manager) CancelRequestToJoin(request *requests.CancelRequestToJoinCommu
return nil, nil, err
}
dbRequest.State = RequestToJoinStateCanceled
if err := m.markRequestToJoinAsCanceled(pk, community); err != nil {
return nil, nil, err
}

View File

@ -1183,6 +1183,8 @@ func (s *MessengerCommunitiesSuite) TestCancelRequestAccess() {
response, err = s.alice.CancelRequestToJoinCommunity(requestToCancel)
s.Require().NoError(err)
s.Require().NotNil(response)
s.Require().Len(response.RequestsToJoinCommunity, 1)
s.Require().Equal(communities.RequestToJoinStateCanceled, response.RequestsToJoinCommunity[0].State)
// pull to make sure it has been saved
cancelRequestsToJoin, err := s.alice.MyCanceledRequestsToJoin()

View File

@ -685,6 +685,8 @@ func (m *Messenger) CancelRequestToJoinCommunity(request *requests.CancelRequest
response := &MessengerResponse{}
response.AddCommunity(community)
response.RequestsToJoinCommunity = append(response.RequestsToJoinCommunity, requestToJoin)
return response, nil
}