hnt
Browse files
frontend/src/store/reducers/authSlice.js
CHANGED
|
@@ -226,7 +226,14 @@ export const registerUser = createAsyncThunk(
|
|
| 226 |
'auth/register',
|
| 227 |
async (userData, { rejectWithValue }) => {
|
| 228 |
try {
|
| 229 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 230 |
return response.data;
|
| 231 |
} catch (error) {
|
| 232 |
return rejectWithValue(error.response.data);
|
|
|
|
| 226 |
'auth/register',
|
| 227 |
async (userData, { rejectWithValue }) => {
|
| 228 |
try {
|
| 229 |
+
// Transform the userData to match backend expectations
|
| 230 |
+
const transformedData = {
|
| 231 |
+
email: userData.email,
|
| 232 |
+
password: userData.password,
|
| 233 |
+
confirm_password: userData.confirmPassword // Transform confirmPassword to confirm_password
|
| 234 |
+
};
|
| 235 |
+
|
| 236 |
+
const response = await authService.register(transformedData);
|
| 237 |
return response.data;
|
| 238 |
} catch (error) {
|
| 239 |
return rejectWithValue(error.response.data);
|