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

@ -276,8 +276,8 @@ var _bintree = &bintree{nil, map[string]*bintree{
"tests": {nil, map[string]*bintree{
"qr": {nil, map[string]*bintree{
"QRWithLogo.png": {_assetsTestsQrQrwithlogoPng, map[string]*bintree{}},
"defaultQR.png": {_assetsTestsQrDefaultqrPng, map[string]*bintree{}},
"status.png": {_assetsTestsQrStatusPng, map[string]*bintree{}},
"defaultQR.png": {_assetsTestsQrDefaultqrPng, map[string]*bintree{}},
"status.png": {_assetsTestsQrStatusPng, map[string]*bintree{}},
}},
}},
}},

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
}