cross-solution / YAWIK

YAWIK is a web application. It can be used as an ATS applicant tracking system or as a jobboard.
https://yawik.org
MIT License
124 stars 67 forks source link

JobsByOrganizationAPI should return JSON by default, JSON-P via Parameter #477

Closed mbo-s closed 6 years ago

mbo-s commented 6 years ago

Currently the jobapi returns JSON-P with a hardcoded yawikParseJobs https://github.com/cross-solution/YAWIK/blob/develop/module/Jobs/src/Jobs/Controller/ApiJobListByOrganizationController.php#L45 e.g. https://yawik.org/demo/de/api/jobs/organization/55ae775c6b10f8f05b8b457f

Is it possible to return by default only JSON and JSON-P via a dynamic callback Parameter e.g. https://yawik.org/demo/de/api/jobs/organization/55ae775c6b10f8f05b8b457f?callback=mycallbackfunction

@TiSiE what do you think?

cbleek commented 6 years ago

this is much better than the current hardcoded callback name.

I've implemented the callback name as an additional route parameter.

So an URL will look like api/jobs/organization/55ae775c6b10f8f05b8b457f/myCallBack

cbleek commented 6 years ago

Works now as requested