export const addTeamReview = createAsyncThunk(
"team/addTeamReview",
async (teamId, comment, { getState }) => {
const {
userLogin: { userInfo },
} = getState();
try {
await axios.post(`/api/teams/${teamId}/review`, comment, {
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${userInfo.token}`,
},
});
} catch (error) {
console.log(error);
}
}
);
In this code, I cannot place {getState}
as 2nd parameter.I dont know what to do when when we have more than one parameter
I tried putting getState in 2nd and comment object in third..but its not working. Also, i tried passing both teamId and comment in one object..that too isn't working