Imageless event returns a boolean in json
-
when I create an event and I don’t attach an image, the json for image return a boolean when should I return null .
Here the correct code when the event have an image.
{ "events":[ { "id":4651, "title":"Test title", "description":"testttt", "image": { url: "https://myhost.tv/wp-content/uploads/2019/07/event2.jpg", id: "4652"} } ] }
But when I create an event and I don’t attach any images the json is the following:
{ "events":[ { "id":4651, "title":"Stand Up Comedy", "description":"testttt", "image":false } ] }
Return: “image”:false
How could you solve this situation so that I return “null” and not “false”
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Imageless event returns a boolean in json’ is closed to new replies.