Closed Micah456 closed 2 months ago
Will need to add to test in separate issue - once finished 'gets' (#4), include those in the test for create user
Change to task 3 - the data and the error messages are not shown in the response. This might change after I've created the getters. For now, it will just show whether or not resource was created.
[x] Create the function to create row in database table: Takes 2 arguments: table name, object dict (data). Create the insert statement. Create a function to parse the keys and values from the object dict to get the column headers and the values. Open connection to database and execute statement. Error handle as appropriate. If successful, return true, else, return false.
[x] Create a test: test normal data and then test with incorrect table name
[x] Create endpoints for object creation: Create 3 endpoints for the POST method: database/user, database/routine, and database/step and have them take JSON data, convert to python dict, call the create object function, return JSON with the appropriate status code and the following data: If true is returned by the function: {"Success: true, "Message": {"Table": "TableName", "Data": DictAsJSONObject} If false is returned: {"Success": False, "Message": "error message"}
[x] Test endpoints in postman