Merge branch 'dismiss-memberships' into 'develop'
useGroupMembershipRequests: dismiss instead of decrement See merge request soapbox-pub/soapbox!2481
This commit is contained in:
commit
bf7d7f93a5
1 changed files with 3 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
import { Entities } from 'soapbox/entity-store/entities';
|
import { Entities } from 'soapbox/entity-store/entities';
|
||||||
import { useEntities, useIncrementEntity } from 'soapbox/entity-store/hooks';
|
import { useDismissEntity, useEntities } from 'soapbox/entity-store/hooks';
|
||||||
import { useApi } from 'soapbox/hooks/useApi';
|
import { useApi } from 'soapbox/hooks/useApi';
|
||||||
import { accountSchema } from 'soapbox/schemas';
|
import { accountSchema } from 'soapbox/schemas';
|
||||||
import { GroupRoles } from 'soapbox/schemas/group-member';
|
import { GroupRoles } from 'soapbox/schemas/group-member';
|
||||||
|
@ -23,13 +23,13 @@ function useGroupMembershipRequests(groupId: string) {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const { incrementEntity: authorize } = useIncrementEntity(path, -1, async (accountId: string) => {
|
const { dismissEntity: authorize } = useDismissEntity(path, async (accountId: string) => {
|
||||||
const response = await api.post(`/api/v1/groups/${groupId}/membership_requests/${accountId}/authorize`);
|
const response = await api.post(`/api/v1/groups/${groupId}/membership_requests/${accountId}/authorize`);
|
||||||
invalidate();
|
invalidate();
|
||||||
return response;
|
return response;
|
||||||
});
|
});
|
||||||
|
|
||||||
const { incrementEntity: reject } = useIncrementEntity(path, -1, async (accountId: string) => {
|
const { dismissEntity: reject } = useDismissEntity(path, async (accountId: string) => {
|
||||||
const response = await api.post(`/api/v1/groups/${groupId}/membership_requests/${accountId}/reject`);
|
const response = await api.post(`/api/v1/groups/${groupId}/membership_requests/${accountId}/reject`);
|
||||||
invalidate();
|
invalidate();
|
||||||
return response;
|
return response;
|
||||||
|
|
Loading…
Reference in a new issue