Skip to content

Commit

Permalink
did something
Browse files Browse the repository at this point in the history
  • Loading branch information
code-wolf-byte committed Dec 2, 2024
1 parent 75517ce commit 3ee0c75
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/pages/CreateUserPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,23 @@ const CreateUserPage = () => {
setLoading(true);
setError('');
setSuccessMessage('');


// Validate fields
if (!email || !name || !asuId || !academicStanding || !major) {
setError('All fields are required. Please fill out the form completely.');
setLoading(false);
return;
}

const data = {
email,
name,
asu_id: asuId,
academic_standing: academicStanding,
major,
};


console.log(data);
try {
const response = await apiClient.post('users/createUser', data);
setSuccessMessage(response.data.message);
Expand All @@ -48,6 +56,7 @@ const CreateUserPage = () => {
setLoading(false);
}
};


return (
<div className="min-h-screen flex bg-gray-900 text-white">
Expand Down

0 comments on commit 3ee0c75

Please sign in to comment.