3.02
This commit is contained in:
parent
22a7753a4f
commit
457e9f6301
File diff suppressed because one or more lines are too long
@ -81,6 +81,7 @@ export const authSlice = createSlice({
|
|||||||
extraReducers: (builder) => {
|
extraReducers: (builder) => {
|
||||||
builder.addCase(loginUser.pending, (state) => {
|
builder.addCase(loginUser.pending, (state) => {
|
||||||
state.isFetching = true;
|
state.isFetching = true;
|
||||||
|
state.errorMessage = '';
|
||||||
});
|
});
|
||||||
builder.addCase(loginUser.fulfilled, (state, action) => {
|
builder.addCase(loginUser.fulfilled, (state, action) => {
|
||||||
const token = action.payload;
|
const token = action.payload;
|
||||||
@ -94,7 +95,7 @@ export const authSlice = createSlice({
|
|||||||
});
|
});
|
||||||
|
|
||||||
builder.addCase(loginUser.rejected, (state, action) => {
|
builder.addCase(loginUser.rejected, (state, action) => {
|
||||||
state.errorMessage = String(action.payload) || 'Something went wrong. Try again';
|
state.errorMessage = action.payload?.message || action.error?.message || 'Something went wrong. Try again';
|
||||||
state.isFetching = false;
|
state.isFetching = false;
|
||||||
});
|
});
|
||||||
builder.addCase(findMe.pending, () => {
|
builder.addCase(findMe.pending, () => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user