Hello everyone,
I have an issue that I am trying to resolve for some time now, and I can't seem to find the answer anywhere, so I am asking here.
Problem Statement:
I have a table which is called "tattoo_images" which stores images of tattoos and another table which is called "tattoo_styles". The tattoo_images has a reference to the tattoo styles via a foreign key called tattoo_styles_id
Now, I allow users to select multiple tattoo_styles on the frontend. The expectation is that the user then sees all images, for the filters that he clicked:
For example, if I click "Traditional Style" (id = 1), and "Watercolor Style" (id=2) then both ID's should be sent as a query parameter and the endpoint should return all images with the selected styles (in this case Traditional Style and Watercolor Style)
What I have done so far:
I tried two different approaches so far:
Passing each tattoo_style_id as a separate query param:
/tattoo_images?page=1&tattoo_styles_id=3&tattoo_styles_id=1
Passing them as an array:
/tattoo_images?page=1&tattoo_styles_id=1,3 or
/tattoo_images?page=1&tattoo_styles_id=[1,3]
On Xano side, I implemented this mechanism:
For the first approach it actually works, but it will always only return the images with latest selected style (e.g. &tattoo_styles_id=3&tattoo_styles_id=1 will only return images with id = 1, even though I am sending both 1 and 3)
The array approach does not work at all, I usually get back an input error, like this one:
Could someone help me figure this one out? I would be really thankful.
Thanks in advance for everyone who takes the time to read through this. I appreciate every feedback I can get!