Fixed missing params for paging cars
MODIFY
src/server/rest/service/CarService.ts
src/server/rest/service/CarService.ts
@@ -138,10 +138,10 @@ export default class CarService {
}
// Filter
const filteredRequest = CarSecurity.filterCarCatalogImagesRequest(req.query);
- UtilsService.assertIdIsProvided(action, filteredRequest.CarID, MODULE_NAME, 'handleGetCarCatalogImages', req.user);
+ UtilsService.assertIdIsProvided(action, filteredRequest.ID, MODULE_NAME, 'handleGetCarCatalogImages', req.user);
// Get the car
const carCatalogImages = await CarStorage.getCarCatalogImages(
- filteredRequest.CarID,
+ filteredRequest.ID,
{ limit: filteredRequest.Limit, skip: filteredRequest.Skip }
);
// Return

MODIFY
src/server/rest/service/security/CarSecurity.ts
src/server/rest/service/security/CarSecurity.ts
@@ -33,7 +33,7 @@ export default class CarSecurity {
public static filterCarCatalogImagesRequest(request: any): HttpCarCatalogImagesRequest {
const filteredRequest: HttpCarCatalogImagesRequest = {
- CarID: sanitize(request.ID),
+ ID: sanitize(request.ID),
} as HttpCarCatalogImagesRequest;
UtilsSecurity.filterSkipAndLimit(request, filteredRequest);
UtilsSecurity.filterSort(request, filteredRequest);

MODIFY
src/types/requests/HttpCarRequest.ts
src/types/requests/HttpCarRequest.ts
@@ -13,7 +13,7 @@ export interface HttpCarMakersRequest extends HttpDatabaseRequest {
}
export interface HttpCarCatalogImagesRequest extends HttpDatabaseRequest {
- CarID: number;
+ ID: number;
}
export interface HttpCarCatalogByIDRequest {

Fixed missing params for paging cars