Fix sanitize aggregate on parse objects (#8423)

This commit is contained in:
José Varela
2021-09-29 16:32:06 +01:00
committed by GitHub
parent bd791bcb95
commit 15859e5316

View File

@@ -108,8 +108,8 @@ function sanitizeAggregate(rawAggregate: any): Aggregate {
}
}
for (const [operation, fields] of Object.entries(rawAggregate)) {
if (typeof fields === 'string') aggregate[operation as keyof Aggregate] = fields.split(',');
for (const [operation, fields] of Object.entries(aggregate)) {
if (typeof fields === 'string') aggregate[operation as keyof Aggregate] = (fields as string).split(',');
else if (Array.isArray(fields)) aggregate[operation as keyof Aggregate] = fields as string[];
}