Refactor register and login thunks

This commit is contained in:
Alex Holliday committed 2024-08-17 13:03:24 -07:00
1 parent 41f975cdfa
commit 46bd317760
2 files changed
+16 -2

No files matched your search

+2 -2
View File
@@ -14,7 +14,7 @@ export const register = createAsyncThunk(
"auth/register",
async (form, thunkApi) => {
try {
const res = await axiosInstance.post("/auth/register", form);
const res = await axiosInstance.registerUser(form);
return res.data;
} catch (error) {
if (error.response.data) {
@@ -31,7 +31,7 @@ export const register = createAsyncThunk(
export const login = createAsyncThunk("auth/login", async (form, thunkApi) => {
try {
const res = await axiosInstance.post(`/auth/login`, form);
const res = await axiosInstance.loginUser(form);
return res.data;
} catch (error) {
if (error.response && error.response.data) {