MLH-Fellowship / orientation-project-python-24.SPR.A

Orientation Project (Python for 24.SPR.A)
1 stars 3 forks source link

Implement API route to add new "Education" #19

Open MLHProgram opened 9 months ago

MLHProgram commented 9 months ago

On the /resume/education route, you should:

andyjianzhou commented 5 months ago

I can work on this!

andyjianzhou commented 5 months ago

Hey, what is the id supposed to be? The testcase is pretty confusing.

  1. I incremented ID by one. If there's an original education listed, ID would increment by 1 (like how it works in a database).
  2. I made it so that ID does not exist, in which test_education fails, searching for an ID
  3. I made it so that ID maintains the same value (allows repeats) if there's already an entry. In which it says that ID is an extra field.
andyjianzhou commented 5 months ago

Got it working, but testcase doesn't follow how db would work/data persistence? It's taking the "index" as the id. The ID field is never being actually set in data.json for a new education post. Works, testcase passes, it returns index as "id", which I assume is the correct implementation. Maybe for future, also match IDs. If there's an existing post, it will generate id + 1. Current data.json has an ID field. However, the testcase expects new post to NOT have an id field - which makes it confusing.