Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the bugs #20

Merged
merged 1 commit into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/controllers/api/v1/users_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ module.exports.editProfile = async function (req, res) {
user.role = req.body.role;
user.address = req.body.address;
user.phonenumber = req.body.phonenumber;
user.hours = req.body.hours;
//user.hours = req.body.hours;
user.availability = req.body.availability;
user.gender = req.body.gender;
// user.dob = req.body.dob;
Expand Down
4 changes: 2 additions & 2 deletions backend/models/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const applicationSchema = new mongoose.Schema({
default: "",
},
applicantskills: {
type: String,
default: "",
type: Array,
default: [],
},
phonenumber: {
type: String,
Expand Down
14 changes: 6 additions & 8 deletions frontend/src/Pages/Profile/ProfileEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ const ProfileEdit = ({ props }: { props: any }) => {
skills,
phonenumber,
availability,
gender,
hours,
gender
} = props;
console.log('prop',props);
//console.log('prop',props);
const form = useForm<FormValues>({
defaultValues: {
name: name,
Expand All @@ -54,8 +53,7 @@ const ProfileEdit = ({ props }: { props: any }) => {
skills: skills,
phonenumber: phonenumber,
availability: availability,
gender: gender,
hours: hours,
gender: gender
},
});
const [availabilityDrop, setAvailabilityDtop] = useState(availability);
Expand Down Expand Up @@ -86,7 +84,6 @@ const ProfileEdit = ({ props }: { props: any }) => {
password,
address: data.address,
availability: availabilityDrop,
hours: data.hours,
gender: data.gender,
skills: newskills,
phonenumber: data.phonenumber,
Expand All @@ -98,7 +95,8 @@ const ProfileEdit = ({ props }: { props: any }) => {
return;
}
toast.success("Saved profile");
login(email, password, navigate);
navigate("/logout");
//login(email, password, navigate);
});
};

Expand Down Expand Up @@ -127,7 +125,7 @@ const ProfileEdit = ({ props }: { props: any }) => {
<TextField
label="Email"
type="email"
{...register("address", {
{...register("email", {
required: "Email is required",
})}
error={!!errors.email}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Job/JobEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const JobEdit = () => {
location: data.location,
pay: data.pay,
description: data.description,
requiredSkills: data.requiredSkills,
requiredSkills: requiredSkills,
};
console.log(body);
axios.post(url, body).then((res) => {
Expand Down
Loading