sirlawglobal / OSAAGOS-API-Alumni-Website

https://osaagos-api-alumni-website.onrender.com
0 stars 0 forks source link

Job Validation Failed: "postedBy" Field is Required #5

Closed preete126 closed 2 months ago

preete126 commented 3 months ago

While attempting to add a new job posting, the following validation error occurs: "Job validation failed: postedBy: Path postedBy is required."

The postedBy field is required in the job schema but is not being populated before the job creation request is sent to the server. The postedBy field should be automatically populated with the ID or name of the user who is creating the job post.

sirlawglobal commented 2 months ago

request...{ "title": "Junior Web Developer", "description": "Assist in the development of web applications.", "companyName": "Tech Innovators", "location": "Remote", "salaryRange": "$50,000 - $60,000", "employmentType": "full-time", "applicationDeadline": "2024-09-30" } response.........{ "_id": "64d5e4b8f7f8a3e4b1c4d6e7", "title": "Junior Web Developer", "description": "Assist in the development of web applications.", "companyName": "Tech Innovators", "location": "Remote", "salaryRange": "$50,000 - $60,000", "employmentType": "full-time", "postedBy": "64d5e4a1c5f8b3d1a5f6e3a4", // User ID from req.user.id "postedDate": "2024-08-16T00:00:00.000Z", "applicationDeadline": "2024-09-30T00:00:00.000Z", "createdAt": "2024-08-16T00:00:00.000Z", "updatedAt": "2024-08-16T00:00:00.000Z" } once confirmed, kindly close this ticket....

Kolagolden commented 2 months ago

Has this been fixed?

sirlawglobal commented 2 months ago

Yes.. it's..

Once you confirm it, kindly close it... Thanks