Updated avrop params to match API
This commit is contained in:
@@ -103,15 +103,15 @@ export class AvropService {
|
||||
}
|
||||
|
||||
private _getParams(type: 'avrop' | 'kommuner' | 'tjanster' | 'utforandeVerksamheter'): Params {
|
||||
const tjanstKod = this._filteredTjanster$.getValue()?.length
|
||||
? { tjanstKod: this._filteredTjanster$.getValue().map(tjanst => tjanst.id) }
|
||||
const tjanstKoder = this._filteredTjanster$.getValue()?.length
|
||||
? { tjanstKoder: this._filteredTjanster$.getValue().map(tjanst => tjanst.id) }
|
||||
: null;
|
||||
const kommunKod = this._filteredKommuner$.getValue()?.length
|
||||
? { kommunKod: this._filteredKommuner$.getValue().map(kommun => kommun.id) }
|
||||
const kommunKoder = this._filteredKommuner$.getValue()?.length
|
||||
? { kommunKoder: this._filteredKommuner$.getValue().map(kommun => kommun.id) }
|
||||
: null;
|
||||
const utforandeverksamhetId = this._filteredUtforandeVerksamheter$.getValue()?.length
|
||||
const utforandeverksamhetIds = this._filteredUtforandeVerksamheter$.getValue()?.length
|
||||
? {
|
||||
utforandeverksamhetId: this._filteredUtforandeVerksamheter$
|
||||
utforandeverksamhetIds: this._filteredUtforandeVerksamheter$
|
||||
.getValue()
|
||||
.map(utforandeVerksamhet => utforandeVerksamhet.id),
|
||||
}
|
||||
@@ -120,26 +120,26 @@ export class AvropService {
|
||||
switch (type) {
|
||||
case 'avrop':
|
||||
return {
|
||||
...tjanstKod,
|
||||
...kommunKod,
|
||||
...utforandeverksamhetId,
|
||||
...tjanstKoder,
|
||||
...kommunKoder,
|
||||
...utforandeverksamhetIds,
|
||||
page: this._page$.getValue().toString(),
|
||||
limit: this._limit$.getValue().toString(),
|
||||
};
|
||||
case 'kommuner':
|
||||
return {
|
||||
...tjanstKod,
|
||||
...utforandeverksamhetId,
|
||||
...tjanstKoder,
|
||||
...utforandeverksamhetIds,
|
||||
};
|
||||
case 'tjanster':
|
||||
return {
|
||||
...kommunKod,
|
||||
...utforandeverksamhetId,
|
||||
...kommunKoder,
|
||||
...utforandeverksamhetIds,
|
||||
};
|
||||
case 'utforandeVerksamheter':
|
||||
return {
|
||||
...tjanstKod,
|
||||
...kommunKod,
|
||||
...tjanstKoder,
|
||||
...kommunKoder,
|
||||
};
|
||||
default:
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user