Zaydme / strapi-plugin-multi-select

A strapi custom field for a multi select input.
https://www.npmjs.com/package/strapi-plugin-multi-select
MIT License
39 stars 21 forks source link

Unselected MultiSelect field shown as empty array in API #13

Closed kupeliorhun closed 1 year ago

kupeliorhun commented 1 year ago

Hi, 

I have a multi-select field X which is a non-required field. Initially, I got null from the API if I didn't select any values for it. However, once I selected multiple items and unselected them, I got an empty array instead of null from the API. Could you please make a change so that if there is no value selected, the API returns null?

The reason that I need such a change is that the filters don't work well with empty arrays in Strapi.

Thank you

Zaydme commented 1 year ago

fixed in https://github.com/Zaydme/strapi-plugin-multi-select/commit/caf0b07f9ddd1fcbd1a3aa13efab4c6d5c4dc9b0