Skip to content

Commit bf6c355

Browse files
committed
fix(core): Do not serialize non-multi params into an array
1 parent ec9d36f commit bf6c355

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

projects/ngqp/core/src/lib/query-param-group.directive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ export class QueryParamGroupDirective implements OnInit, OnDestroy {
158158
};
159159
}
160160

161-
private serialize<T = any>(queryParam: QueryParam<T | T[]>, value: T): string[] {
161+
private serialize<T = any>(queryParam: QueryParam<T | T[]>, value: T): string | string[] {
162162
return hasArrayValue(queryParam, value)
163163
? (value || <T[]>[]).map(queryParam.serialize)
164-
: [queryParam.serialize(value)];
164+
: queryParam.serialize(value);
165165
}
166166

167167
private deserialize<T = any>(queryParam: QueryParam<T>, values: string | string[]): Unpack<T> | Unpack<T>[] {

0 commit comments

Comments
 (0)