ggelashvili / expennies

135 stars 47 forks source link

draw param in datatable is not incrementing in production. #4

Closed davidfeldt closed 10 months ago

davidfeldt commented 10 months ago

I have a weird issue. I've deployed the codebase on a DigitalOcean droplet and everything is working 100% except for the table redraws with datatable.net. The request params to the server include draw=x and x increments on each redraw, but the response from the server shows the following:

data: [{...},{...},{...}], draw: 0, recordsTotal: 3, recordsFiltered: 3

So the tables are not displayed.

When I run the code on localhost on my local machine, the tables render correctly and the draw count is shown as incrementing each time.

Any ideas?

davidfeldt commented 10 months ago

Found the issue.

Nginx config on Digital Ocean (Ubuntu) was not returning the draw parameter which is the first parameter in the list of parameters.

The returned parameter list includes the "?" so $params['draw'] is undefined.

For example: GET /users/load?draw=1... returns first parameter with key ?draw instead of draw