ubclaunchpad / Internado

🌪 Find Internship Opportunities
3 stars 1 forks source link

208 - Added endpoints for getting, posting and deleting jobs. #211

Closed cowmanjoe closed 5 years ago

cowmanjoe commented 5 years ago

🔨 Changes

EDIT: these were old instructions after 1 before Swagger support, leaving them here in case you want to use them for whatever reason.

  1. Open Postman or whatever program for hitting API endpoints
  2. POST an array of jobs by taking the entire jobs object from data_acquisition/sample_response.json and putting it in the request body as JSON
  3. POST a job by taking a single job object from the jobs array in data_acquisition/sample_response.json and putting it in the request body as JSON
  4. GET a job by taking the ID from the response to the POST in (4) and calling GET/job?id={ID}
  5. DELETE a job by using the same ID and calling DELETE/job?id={ID}
  6. Verify the job is deleted by calling GET/job?id={ID}
  7. Try other edge cases like incorrect ID and anything else you can think to see if it breaks

:clipboard: Checklist

cowmanjoe commented 5 years ago

One problem I see with this change is that there isn't a POST call for just a Job as we have defined it, only for ZipRecruiter job objects. Do you guys think we need to implement this now, or should it be a different ticket? Also, should the name of this endpoint be different since it is specific to ZipRecruiter? Maybe in the future I could implement it so that there is a field in the request that specifies what kind of schema (i.e. ZipRecruiter, our schema, Indeed).

frostyshadows commented 5 years ago

@cowmanjoe would it make more sense for postJob to take in a generic job and expect the conversion to be done by the data acquisition part instead instead?

cowmanjoe commented 5 years ago

@sherry I think I agree about posting jobs as our job schema rather than ZipRecruiter's