Skip to content
Snippets Groups Projects
Commit 0869cf2b authored by Hugo NOUTS's avatar Hugo NOUTS
Browse files

Merge branch '58-orientation-rdvs' into 'dev'

:bug: filter keys are cast to booleans whatever the case (upper or lower)

See merge request !265
parents 5c598764 3b2fdce9
No related branches found
No related tags found
2 merge requests!272V2.1.3,!265🐛 filter keys are cast to booleans whatever the case (upper or lower)
......@@ -208,13 +208,14 @@ export class StructuresService {
* Parse filter value from string to boolean and map filter category to categories key
* @param filters
*/
private parseFilter(filters: Array<any>): Array<any> {
private parseFilter(filters: Array<{ [key: string]: unknown }>): Array<{ [key: string]: unknown }> {
return filters.map((filter) => {
const key = Object.keys(filter)[0];
if (filter[key] === 'True') {
const [key, value] = Object.entries(filter)[0];
if (typeof value === 'string' && value.toLowerCase() === 'true') {
return { [key]: true };
} else {
return { [`categories.${key}`]: filter[key] };
return { [`categories.${key}`]: value };
}
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment