Closed franziska-caroline closed 10 months ago
Looks quite good overall!
Just two suggestions:
plants
, so the path would be pages/api/plants/index.js
and pages/api/plants/[id]/index.js
. This would be helpful if you plan to use other models (like the Journal) as well, so you would have some separation here. But in a first iteration it´s also ok to do it in the way you outlined it.Plant
instead of Plants
– db/models/Plant.js
) – the DB collection will be called plants
automatically thereafter.These are just suggestions and implementation details that go into more detail than usually necessary 😃
Thank you @ThomasKirst ! We have adopted your comments so that we can be more open about how we work with the Db in the future and whether further models will be added. :)
Value proposition
As a plant enthusiast, I want my data to be securely stored and accessible across devices, so that I can have a persistent and consistent, personalized experience.
Description
Acceptance criteria
Tasks
lib/data.js
(without the id) to create a collectiondb/connect.js
filedb/models/Plant.js
and create a schemapages/api/plants/index.js
andpages/api/plant/[id]/index.js
pages/api/index.js
write function for GET request for all plantspages/api/[id]/index.js
write function for GET request for the details page