Add request to response when canceling request
This commit is contained in:
parent
7123b22c52
commit
5d81866957
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue