Skip to content

Commit

Permalink
fix: Renamed service function
Browse files Browse the repository at this point in the history
  • Loading branch information
josebui committed Nov 29, 2023
1 parent b9fd91e commit fd7d369
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/group/components/GroupList.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import PageHeader from 'layout/PageHeader';
import PageLoader from 'layout/PageLoader';
import {
fetchGroups,
joinGroupFromList,
joinGroupFromListPage,
leaveGroupFromList,
} from 'group/groupSlice';
import GroupMemberJoin from 'group/membership/components/GroupMemberJoin';
Expand Down Expand Up @@ -76,7 +76,7 @@ const MembershipButton = ({ group, tabIndex }) => {

const onMemberJoin = () => {
dispatch(
joinGroupFromList({
joinGroupFromListPage({
groupSlug: group.slug,
})
);
Expand Down
4 changes: 2 additions & 2 deletions src/group/groupService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,12 @@ export const leaveGroupFromList = (
.then(extractGroup);
};

export const joinGroupFromList = (
export const joinGroupFromListPage = (
{ groupSlug }: { groupSlug: string },
user: User | null
) => {
const query = graphql(`
mutation joinGroupFromList($input: GroupMembershipSaveMutationInput!) {
mutation joinGroupFromListPage($input: GroupMembershipSaveMutationInput!) {
saveGroupMembership(input: $input) {
group {
...groupFields
Expand Down
12 changes: 6 additions & 6 deletions src/group/groupSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ export const leaveGroupFromList = createAsyncThunk(
'group/leaveGroupFromList',
groupService.leaveGroupFromList
);
export const joinGroupFromList = createAsyncThunk(
'group/joinGroupFromList',
groupService.joinGroupFromList
export const joinGroupFromListPage = createAsyncThunk(
'group/joinGroupFromListPage',
groupService.joinGroupFromListPage
);
export const changeMemberRole = createAsyncThunk(
'group/changeMemberRole',
Expand Down Expand Up @@ -409,21 +409,21 @@ const groupSlice = createSlice({
);
});

builder.addCase(joinGroupFromList.pending, (state, action) => {
builder.addCase(joinGroupFromListPage.pending, (state, action) => {
return updateGroupListItem(
state,
action.meta.arg.groupSlug,
_.set('accountMembership.fetching', true)
);
});
builder.addCase(joinGroupFromList.fulfilled, (state, action) => {
builder.addCase(joinGroupFromListPage.fulfilled, (state, action) => {
return updateGroupListItem(
state,
action.meta.arg.groupSlug,
() => action.payload
);
});
builder.addCase(joinGroupFromList.rejected, (state, action) => {
builder.addCase(joinGroupFromListPage.rejected, (state, action) => {
return updateGroupListItem(
state,
action.meta.arg.groupSlug,
Expand Down

0 comments on commit fd7d369

Please sign in to comment.