North-Seattle-College / ad440-winter2021-thursday-repo

NSC AD 440 Winter 2021 Thursday cohort practicum repo
Apache License 2.0
2 stars 27 forks source link

Adds React UI for creating a task #225

Closed andluc21 closed 1 year ago

andluc21 commented 3 years ago

resolve #193

This feature adds a form that allows the creation of a new task based on a given user. This added feature takes the form data except the User ID and creates corresponding JSON (using JS code) and passes this JSON as a body of the request to the API endpoint. The userId is implemented into the link - it is a dynamic of the API URL Endpoint of the API that is handled in CreateTask.js

Testing

Screen Shot 2021-03-03 at 8 02 20 PM Screen Shot 2021-03-03 at 8 16 14 PM

Troubleshooting Tips

There are 2 outputs from the console when creating a task, The first number is the userID that the task is going towards and the second field is the task in JSON format. If these two dont show up it can be linked back to this functions and if a error shows up when creating the task there is a number that will indicate where the error should be.

Date Activity Time Spent
2/25/2021 Research form handling in React 3 hours
2/28/2021 Create Class version of the form 2 hours
3/1/2021 Create a Functional version of the form 2 hours
3/2/2021 Implement userID function with POST 3 hours
3/3/2021 Fix bugs 4 hours
unicornsleuth commented 3 years ago
andluc21 commented 3 years ago

Its a good question! I was kind of thrown for a loop with this task because the api endpoint for the tasks isnt working completely so this PR creates a resource and the task complete is a 201 resource creation message. It's set up to make a POST and should be going to the endpoint when its hooked up properly. Toddy recommended I make the dynamic part of the URL of the API handled directly in the JS so I just focused on that, I suppose this PR is sort of dependent on another task and might need some updating after that.