Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ describe('TableSelectionResponseMapper', () => {
it('should map the selection response to an array of SelectedVBValues', () => {
const response: SelectionResponse = {
language: '',
selection: {
selection: [
selection: [
{
variableCode: 'testVarCode',
valueCodes: ['testValueCode'],
Expand All @@ -19,7 +18,6 @@ describe('TableSelectionResponseMapper', () => {
valueCodes: ['testValueCode2'],
},
],
},
links: [],
};

Expand Down
2 changes: 1 addition & 1 deletion apps/pxweb2/src/mappers/TableSelectionResponseMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function mapTableSelectionResponse(
response: SelectionResponse
): VariableWithCodelistValue[] {
const selectedVBValues: VariableWithCodelistValue[] =
response.selection.selection.map((variable) => {
response.selection.map((variable) => {
return {
id: variable.variableCode,
selectedCodeList: variable.codeList ? variable.codeList : undefined,
Expand Down
5 changes: 2 additions & 3 deletions libs/pxweb2-api-client/src/models/SelectionResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
/* eslint-disable */
import type { Link } from './Link';
import type { VariablesSelection } from './VariablesSelection';
export type SelectionResponse = {
export type SelectionResponse = (VariablesSelection & {
/**
* The language code for the language used in this response
*/
language: string;
selection: VariablesSelection;
links: Array<Link>;
};
});

2 changes: 1 addition & 1 deletion libs/pxweb2-api-client/src/models/VariablesSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import type { VariablePlacementType } from './VariablePlacementType';
import type { VariableSelection } from './VariableSelection';
export type VariablesSelection = {
selection: Array<VariableSelection>;
palcement?: VariablePlacementType;
placement?: VariablePlacementType;
};

6 changes: 3 additions & 3 deletions libs/pxweb2-api-client/src/services/ConfigurationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export class ConfigurationService {
method: 'GET',
url: '/config',
errors: {
400: `Error respsone for 400`,
404: `Error respsone for 404`,
429: `Error respsone for 429`,
400: `Error response for 400`,
404: `Error response for 404`,
429: `Error response for 429`,
},
});
}
Expand Down
12 changes: 6 additions & 6 deletions libs/pxweb2-api-client/src/services/NavigationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export class NavigationService {
'lang': lang,
},
errors: {
400: `Error respsone for 400`,
404: `Error respsone for 404`,
429: `Error respsone for 429`,
400: `Error response for 400`,
404: `Error response for 404`,
429: `Error response for 429`,
},
});
}
Expand All @@ -50,9 +50,9 @@ export class NavigationService {
'lang': lang,
},
errors: {
400: `Error respsone for 400`,
404: `Error respsone for 404`,
429: `Error respsone for 429`,
400: `Error response for 400`,
404: `Error response for 404`,
429: `Error response for 429`,
},
});
}
Expand Down
40 changes: 20 additions & 20 deletions libs/pxweb2-api-client/src/services/TableService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ export class TableService {
'lang': lang,
},
errors: {
400: `Error respsone for 400`,
404: `Error respsone for 404`,
429: `Error respsone for 429`,
400: `Error response for 400`,
404: `Error response for 404`,
429: `Error response for 429`,
},
});
}
Expand Down Expand Up @@ -113,9 +113,9 @@ export class TableService {
'defaultSelection': defaultSelection,
},
errors: {
400: `Error respsone for 400`,
404: `Error respsone for 404`,
429: `Error respsone for 429`,
400: `Error response for 400`,
404: `Error response for 404`,
429: `Error response for 429`,
},
});
}
Expand All @@ -141,9 +141,9 @@ export class TableService {
'lang': lang,
},
errors: {
400: `Error respsone for 400`,
404: `Error respsone for 404`,
429: `Error respsone for 429`,
400: `Error response for 400`,
404: `Error response for 404`,
429: `Error response for 429`,
},
});
}
Expand All @@ -168,9 +168,9 @@ export class TableService {
'lang': lang,
},
errors: {
400: `Error respsone for 400`,
404: `Error respsone for 404`,
429: `Error respsone for 429`,
400: `Error response for 400`,
404: `Error response for 404`,
429: `Error response for 429`,
},
});
}
Expand Down Expand Up @@ -213,10 +213,10 @@ export class TableService {
'stub': stub,
},
errors: {
400: `Error respsone for 400`,
403: `Error respsone for 403`,
404: `Error respsone for 404`,
429: `Error respsone for 429`,
400: `Error response for 400`,
403: `Error response for 403`,
404: `Error response for 404`,
429: `Error response for 429`,
},
});
}
Expand Down Expand Up @@ -248,10 +248,10 @@ export class TableService {
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Error respsone for 400`,
403: `Error respsone for 403`,
404: `Error respsone for 404`,
429: `Error respsone for 429`,
400: `Error response for 400`,
403: `Error response for 403`,
404: `Error response for 404`,
429: `Error response for 429`,
},
});
}
Expand Down