small fixes car connector data properties
MODIFY
src/server/rest/v1/service/security/CarSecurity.ts
src/server/rest/v1/service/security/CarSecurity.ts
@@ -90,8 +90,7 @@ export default class CarSecurity {
Search: sanitize(request.Search),
CarMaker: sanitize(request.CarMaker),
WithUser: UtilsSecurity.filterBoolean(request.WithUser),
- UserID: sanitize(request.UserID),
- WithCarConnector: UtilsSecurity.filterBoolean(request.WithCarConnector),
+ UserID: sanitize(request.UserID)
} as HttpCarsRequest;
UtilsSecurity.filterSkipAndLimit(request, filteredRequest);
UtilsSecurity.filterSort(request, filteredRequest);

MODIFY
src/storage/mongodb/CarStorage.ts
src/storage/mongodb/CarStorage.ts
@@ -497,12 +497,14 @@ export default class CarStorage {
amperagePerPhase: Utils.convertToInt(carToSave.converter.amperagePerPhase),
numberOfPhases: Utils.convertToFloat(carToSave.converter.numberOfPhases),
type: carToSave.converter.type
- },
- carConnectorData: {
- carConnectorID: carToSave.carConnectorData.carConnectorID,
- carConnectorMeterID: carToSave.carConnectorData.carConnectorMeterID
}
};
+ if (carToSave.carConnectorData) {
+ carMDB.carConnectorData = {
+ carConnectorID: carToSave.carConnectorData?.carConnectorID ?? null,
+ carConnectorMeterID: carToSave.carConnectorData?.carConnectorMeterID ?? null,
+ };
+ }
// Add Last Changed/Created props
DatabaseUtils.addLastChangedCreatedProps(carMDB, carToSave);
// Modify

MODIFY
src/types/Car.ts
src/types/Car.ts
import { AuthorizationActions } from './Authorization';
-import { CarConnectorConnectionSetting } from './Setting';
import CreatedUpdatedProps from './CreatedUpdatedProps';
export interface CarCatalog extends CreatedUpdatedProps, AuthorizationActions {

small fixes car connector data properties