check query params for null or undefined
This commit is contained in:
parent
85981c1c3f
commit
c16328aa38
@ -40,11 +40,7 @@ export abstract class GenericService<I> {
|
||||
}
|
||||
|
||||
@Validate()
|
||||
delete(
|
||||
@RequiredParam() body: unknown,
|
||||
modelPath = this._defaultModelPath,
|
||||
queryParams?: List<QueryParam>,
|
||||
): Observable<unknown> {
|
||||
delete(@RequiredParam() body: unknown, modelPath = this._defaultModelPath, queryParams?: List<QueryParam>): Observable<unknown> {
|
||||
let path = `/${encodeURI(modelPath)}`;
|
||||
|
||||
if (typeof body === 'string') {
|
||||
@ -121,7 +117,7 @@ export abstract class GenericService<I> {
|
||||
protected _queryParams(queryParams?: List<QueryParam>): HttpParams {
|
||||
let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() });
|
||||
queryParams?.forEach(param => {
|
||||
if (param.value) {
|
||||
if (param?.value !== undefined && param?.value !== null) {
|
||||
queryParameters = queryParameters.append(param.key, param.value);
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user