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

[FEAT] Update A job post by Id #152

Closed
3 tasks
uloamaka opened this issue Jul 27, 2024 · 1 comment
Closed
3 tasks

[FEAT] Update A job post by Id #152

uloamaka opened this issue Jul 27, 2024 · 1 comment
Assignees
Labels
job label related to job features

Comments

@uloamaka
Copy link
Contributor

Description

Implement an Api endpoint to update a job post detail, incase of any omission in job details.

Acceptance Criteria

  • The endpoint should be accessible at api/v1/jobs/:id
  • The endpoint should accept HTTP PATCH requests.
  • The endpoint should check that the user has the appropriate permissions.
  • The endpoint should validate all data passed in the body of the request
  • Requests to the endpoint must include a valid authentication token in the Authorization header. Authorization: Bearer
  • Given a request with a valid job post ID, when the user is authenticated and authorized, the system should update the user with a status code of 200
  • Given a request with an invalid or non-existent user ID, when the user is authenticated and authorised, the system should return a 404 Not Found status.

Request

  • Endpoint: api/v1/jobs/:id
  • Request Body:
{
  "title": "Job Title",
  "description": "Job Description",
  "location": "Job location",
  "salary": "String",
  "job_type": "String",
  "company_name": "String"
}
  • Parameters: (jobpostId) id : string

Expected Outcome

  • Successful Response
{
     "message": "Job details updated successfully",
     "status_code": 200,
     "data": {
           "title": "Job Title",
           "description": "Job Description",
           "location": "Job location",
           "salary": "String",
           "job_type": "String",
           "company_name": "String",
           "created_at": "Timestamp",
           "updated_at": "Timestamp"
         }
} 
  • Error Response
{
  "status_code": 400,
  "message": ["validation error message"],
  "error": "Bad Request"
} 

Purpose

Enable updating of a posted job details, incase of any error(typo, etc)

Requirements

  • Develop server-side logic to update a single job post
  • Ensure compliance with security standards for handling user information.

Checklist

  • Define API endpoint to update job post details.
  • Implement logic to update job post details in the database.
  • Handle success and error responses.

Unit tests

  • Successful response with valid id
  • invalid job post id
  • Missing job post id
  • invalid request body
  • Appropriate status code
@uloamaka
Copy link
Contributor Author

this has been approved on the main repo link

@Cyberguru1 Cyberguru1 added the job label related to job features label Jul 27, 2024
@uloamaka uloamaka mentioned this issue Jul 30, 2024
7 tasks
@uloamaka uloamaka closed this as completed Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
job label related to job features
Projects
None yet
Development

No branches or pull requests

2 participants