You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alright, let us fix this. And by "us", I actually mean someone on the BAYMS web dev team. (In other words, not me.)
Problem
The problem lies in the way the piece ordering system was designed. Fix the piece ordering, and the piece approval process will work much better than before.
Right now, to set the piece order, numerous AJAX calls are being made, one call for each piece in the program. Furthermore, each call is delayed by a couple hundred milliseconds in order to stop the database from locking up. This is a terrible way of handling it, but it was also the simplest way to get a prototype up and running in time for the first event of the year.
Solution
Modify "bayms.php"; add an orderPieces function which accepts an associative array which maps piece_id's to piece_order's. This will allow us to set all the piece_orders in a single API call.
Modify api.php; add a order_pieces API call which will decode a JSON object containing the piece_order's from the REQUEST variable. Call the orderPieces function using this object.
Modify app.js; change the saveOrder function so that it sends all the piece_order values in a single AJAX request.
Extras
To further improve the efficiency, consider minimizing the number of piece_order values being sent. If a value hasn't changed, then don't send it.
To make it even more efficient, consider spacing out the values. Instead of "1, 2, 3, 4, 5...", consider using "10, 20, 30, 40, 50..."; using larger intervals will allow you to later set piece_order's to intermediate values such as 15 and only send a single change... at least, until you run out of room.
No description provided.
The text was updated successfully, but these errors were encountered: