ThemeBoy / SportsPress

An open source league statistics plugin for WordPress created by ThemeBoy.
Other
152 stars 98 forks source link

Error 404 on calling API with Fetch in JS #314

Closed burzumumbra closed 5 years ago

burzumumbra commented 5 years ago

Hi ThemeBoy team, after updating wordpress to 5.0 all my calls to SportsPress Pro Api, get a 404, on Production, Dev and Local environments, and of course whit the last version of SportsPress Pro, I don't thin could something whit wordpress 5.0 because the WP API works the same as before, is just calls to SportsPress Pro API.

PDT: The path in the screen, is just shorted, is actually my domain as root in the path, so I'm not calling the API just from "/wp-json/sportspress/v2/events?per_page=100"

captura

burzumumbra commented 5 years ago

I just come to update the issue, the problem is not whit Wordpress, is the plugin update from days ago. I did a rollback to my last version of the plugin and the APIworks just fine.

savvasha commented 5 years ago

Hi burzumumbra,

We will soon release version 2.6.13 which will solve this issue. Thanks for reporting.

Savvas

burzumumbra commented 5 years ago

@savvasha Good to know, I'll wait to update the plugin.

savvasha commented 5 years ago

New version release that fix this issue: https://github.com/ThemeBoy/SportsPress/commit/eefe954cb044402816f9fde1897d77009d2387ca

burzumumbra commented 5 years ago

Thanks I'll be testing.

burzumumbra commented 5 years ago

@savvasha I have tested the API in 2.6.13, but ther's a problem, I can't acces Tables, Lists and similars. The call to wp-json/sportspress/v2 Shows that for example in list I ther's 4 elements, and then if I go to wp-json/sportspress/v2/lists or wp-json/sportspress/v2/tables I got as response an empty array.

api fail api fail 2

brianmiyaji commented 5 years ago

@burzumumbra Thanks for testing this. You're right, the endpoints for secondary post types (tables, lists, etc) were still following the old logic. I've fix this and we've released version 2.6.14 which should resolve the issue.