Hello-World-Software-Studios / calculator

Carpenter's tool for wall layout
0 stars 1 forks source link

Implement API schema #42

Closed ecumene closed 2 years ago

ecumene commented 3 years ago

API Schema should be:

GET /project/{id}
POST /project
PUT /project
POST /project/{projectId}/walls

HTTP Method Examples:

GET /project/{id}

POST /project

POST /project/{projectId}/walls

  1. Backend get a request with projectId, and Data
  2. You'd get the wallLength and isImperial from Data
  3. You'd calculate a list of values (stud numbers come from getListOfMeasurements)
  4. You'd INSERT that into SQL into the "wall" table with your wall details (wallLength (integer), isImperial (boolean), listOfMeasurements (json))
  5. Return the wall info back (id, wallLength, isImperial, listOfMeasurements)
ecumene commented 3 years ago

Try for next time: Make a POST for /projects and projects/{projectID}/walls

JPM709 commented 3 years ago

Schema is partly implemented. As discussed in issue #40, API works top-down; create a user, get an ID -> use ID to create a related project, get back a project ID -> use projectID when posting walls. EDIT: created user is for show as of now; no cookies or anything yet. no returning user functionality.

ecumene commented 3 years ago

For Users:

/post -> /signup (Does not need auth)
/get -> /current_user (Does need auth)
JPM709 commented 3 years ago

Still need DELETE project and walls.

JPM709 commented 2 years ago

DELETE walls is done. Just need to DELETE project, then API is complete!