Updated route id management
MODIFY
src/assets/server/rest/v1/docs/e-mobility-oas.json
src/assets/server/rest/v1/docs/e-mobility-oas.json
}
}
},
- "/api/chargingstations/{id}/connectors/{connectorId}/qrcode/download": {
+ "/api/chargingstations/qrcode/download": {
"get": {
"security": [
{
"description": "Download connector QRCode as PDF",
"parameters": [
{
- "$ref": "#/components/parameters/chargingStationID"
+ "$ref": "#/components/parameters/ChargingStationID"
},
{
- "$ref": "#/components/parameters/connectorID"
+ "$ref": "#/components/parameters/ConnectorID"
+ },
+ {
+ "$ref": "#/components/parameters/SiteAreaID"
+ },
+ {
+ "$ref": "#/components/parameters/SiteID"
}
],
"tags": [
"$ref": "#/components/responses/BackendError"
}
}
+ }
},
+ "/api/chargingprofiles/{id}": {
"put": {
"security": [
{
}
],
"description": "Update a Charging Station profile",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/chargingProfileID"
+ }
+ ],
"tags": [
"Charging Profiles"
],
"$ref": "#/components/responses/NotSupportedError"
}
}
- }
},
- "/api/chargingprofiles/{id}": {
"delete": {
"security": [
{

MODIFY
src/server/rest/v1/router/api/ChargingStationRouter.ts
src/server/rest/v1/router/api/ChargingStationRouter.ts
@@ -146,8 +146,6 @@ export default class ChargingStationRouter {
protected buildRouteChargingStationDownloadQRCode(): void {
this.router.get(`/${ServerRoute.REST_CHARGING_STATIONS_QRCODE_DOWNLOAD}`, async (req: Request, res: Response, next: NextFunction) => {
- req.query.ChargingStationID = req.params.id;
- req.query.ConnectorID = req.params.connectorId;
await RouterUtils.handleServerAction(ChargingStationService.handleDownloadQrCodesPdf.bind(this), ServerAction.CHARGING_STATION_DOWNLOAD_QR_CODE_PDF, req, res, next);
});
}
@@ -226,7 +224,7 @@ export default class ChargingStationRouter {
}
protected buildRouteChargingStationUpdateChargingProfiles(): void {
- this.router.put(`/${ServerRoute.REST_CHARGING_PROFILES}`, async (req: Request, res: Response, next: NextFunction) => {
+ this.router.put(`/${ServerRoute.REST_CHARGING_PROFILE}`, async (req: Request, res: Response, next: NextFunction) => {
await RouterUtils.handleServerAction(ChargingStationService.handleUpdateChargingProfile.bind(this), ServerAction.CHARGING_PROFILE_UPDATE, req, res, next);
});
}

MODIFY
src/server/rest/v1/service/ChargingStationService.ts
src/server/rest/v1/service/ChargingStationService.ts
@@ -493,7 +493,7 @@ export default class ChargingStationService {
public static async handleUpdateChargingProfile(action: ServerAction, req: Request, res: Response, next: NextFunction): Promise<void> {
// Filter
- const filteredRequest = ChargingStationSecurity.filterChargingProfileUpdateRequest(req.body);
+ const filteredRequest = ChargingStationSecurity.filterChargingProfileUpdateRequest({ ...req.params, ...req.body });
// Check existence
const chargingStation = await ChargingStationStorage.getChargingStation(req.user.tenantID, filteredRequest.chargingStationID);
UtilsService.assertObjectExists(action, chargingStation, `ChargingStation '${filteredRequest.chargingStationID}' does not exist.`,

MODIFY
src/types/Server.ts
src/types/Server.ts
@@ -419,7 +419,7 @@ export enum ServerRoute {
REST_CHARGING_STATIONS_DOWNLOAD_FIRMWARE = 'chargingstations/firmware/download',
REST_CHARGING_STATIONS_QRCODE_GENERATE = 'chargingstations/:id/connectors/:connectorId/qrcode/generate',
- REST_CHARGING_STATIONS_QRCODE_DOWNLOAD = 'chargingstations/:id/connectors/:connectorId/qrcode/download',
+ REST_CHARGING_STATIONS_QRCODE_DOWNLOAD = 'chargingstations/qrcode/download',
REST_CHARGING_STATION_GET_OCPP_PARAMETERS = 'chargingstations/:id/ocpp/parameters',
REST_CHARGING_STATIONS_REQUEST_OCPP_PARAMETERS = 'chargingstations/ocpp/parameters',

Updated route id management