Closed mnogue closed 3 years ago
Fields can contain spaces, but then the field itself would need to be name
for example. It's probably a good idea to trim here anyway though:
to
export const getFields = (config) =>
(config.fields ? config.fields.split(',') : []).map((string) =>
string.trim()
);
or maybe even:
export const getFields = (config) =>
config.fields ? config.fields.split(/[ ,]+/) : [];
what do you think @smomin ?
@Haroenv this makes sense. do you want to create a PR and update tests for this update?
I've been using this extension for a few days now and so far it's working very well. However, although creating a new Firebase document correctly indexed it in Algolia, updating the document did not.
After many hours searching for a possible cause, I noticed there were spaces between each comma, the Firebase Function gets triggered, but nothing is updated in the Algolia counter part. Since indexed fields can't contain spaces (I think?) maybe the function should remove all spaces when parsing the Indexable Fields.
If there's a quirk I'm missing, at least I hope this helps someone like me with OCD who needs to put a space after each comma 😁