temp
This commit is contained in:
@@ -21,8 +21,16 @@ const userSlice = createSlice({
|
||||
|
||||
},
|
||||
extraReducers: (bd) => {
|
||||
bd.addCase(fetchUserData.pending, (state, action) => {
|
||||
state.loading = true
|
||||
})
|
||||
bd.addCase(fetchUserData.fulfilled, (state, action) => {
|
||||
state.data = action.payload
|
||||
console.log("đã vào full", action.payload)
|
||||
state.loading = false
|
||||
state.data = action.payload
|
||||
})
|
||||
bd.addCase(fetchUserData.rejected, (state, action) => {
|
||||
state.loading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -31,8 +39,8 @@ const userSlice = createSlice({
|
||||
const fetchUserData = createAsyncThunk(
|
||||
"user/fetchUserData",
|
||||
async () => {
|
||||
let result = await Apis.user.findById(localStorage.getItem("userLogin"))
|
||||
return result.data
|
||||
let result = await Apis.user.me(localStorage.getItem("token")) as any
|
||||
return result
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user