Connected picture state to redux

This commit is contained in:
Daniel Cojocea committed 2024-07-03 17:49:40 -04:00
1 parent 223dd280d4
commit 7f57f9fa0c
3 files changed
+88 -44

No files matched your search

+2 -2
View File
@@ -41,7 +41,7 @@ export const login = createAsyncThunk("auth/login", async (form, thunkApi) => {
export const update = createAsyncThunk(
"auth/update",
async (data, thunkApi) => {
const { authToken: token, localData: form } = data;
const { authToken: token, toUpdate: form } = data;
const user = jwtDecode(token);
try {
//1.5s delay to show loading spinner
@@ -50,7 +50,7 @@ export const update = createAsyncThunk(
const res = await axios.post(`${BASE_URL}/auth/user/${user._id}`, form, {
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
"Content-Type": "multipart/form-data",
},
});
return res.data;