Closed serveit-ca closed 5 years ago
@serveit-ca you need to talk to the developers on this one.
@serveit-ca Am I ok to continue on this?
@serveit-ca I have made a pull request for this, once the code is live, you will need to call the following code to rebuild the data into the structure we need it. Things WILL be broken until these lines of code have been run.
$database->updateNulls(); $programs->updateProgram(NULL, NULL, NULL, NULL, NULL, NULL, NULL, "No Body Part Assigned", NULL, NULL, NULL, NULL, NULL, 179); $database->fixProgramBodyParts(); $database->fixProgramSportsOcc(); $database->fixProgramHowItHappened();
@SideonDeaka Based on what I am reading here it appears I should be able to update the code on production and run the code in your comment above. The thing we will need to wait for this one on is the app to able to get the body parts, before we push this live or else the app will break.
hey @SideonDeaka, We want to update the API Endpoint to give the string of body parts, occupations, how it happened, etc to still pass the string values rather than the ID's. This means we do not need to update the app but rather we can simply call a PHp function to grab the Names rather than ID's when the JSON endpoint is being built.
The current Endpoint is being constructed in the file Users/nathantymos/Documents/curaDev/curastream/wp-content/themes/medigroup-child/functions.php: 216: 'curastream', '/view_program_details/', 219: 'callback' => 'view_program_details', 1025: function view_program_details($request)
I would recommend that we delete this endpoint from living hear. Its an awful programming practice and instead we move it over to be part of the Curastream plugin.
We can then call the functions to convert the ID's to strings. We also want to ensure we are passing clean data. For example, Ankle, Hand, Arm rather than Ankle , Hand, arm, etc.
Once we have this good to go, please let me know which functions I need to run on production to make things happen.
Ensure that the new endpoint, after refactoring is identical to the current endpoint located at curastream.serveit.work/doc
This end point has been moved to the plugin. We will need to do cleanup on the theme repo at some point, I am now working towards getting the memberpress web hooks working with this endpoint.
I believe this is done and all that is left is ensuring the security of the endpoints #76
This ticket reference #51 and is part of the overall solution.
The goal of this ticket is to ensure that Body Parts, Sports & Occupations and How it Happened are all working off of ID's and arrays of ID's rather than arrays of Strings. This will ensure that a infinate number of programs are resolved.
The following steps will need to be completed