Removed unnecessary timeout and replaced Promise.then()
This commit is contained in:
1 parent
bd5ed007eb
commit
85a2177f1d
2 files changed
+6
-10
No files matched your search
@@ -80,9 +80,6 @@ export const deleteUser = createAsyncThunk(
|
||||
async (data, thunkApi) => {
|
||||
const user = jwtDecode(data);
|
||||
|
||||
//1.5s delay to show loading spinner
|
||||
await new Promise((resolve) => setTimeout(resolve, 1500));
|
||||
|
||||
try {
|
||||
const res = await axiosInstance.delete(`/auth/user/${user._id}`, {
|
||||
headers: { Authorization: `Bearer ${data}` },
|
||||
|
||||
Reference in new issue
Block a user