Added id on reset route
MODIFY
src/assets/server/rest/v1/docs/e-mobility-oas.json
src/assets/server/rest/v1/docs/e-mobility-oas.json
}
}
},
- "/api/chargingstations/reset": {
+ "/api/chargingstations/{id}/reset": {
"put": {
"security": [
{
}
],
"description": "Reset a Charging Station",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/chargingStationID"
+ }
+ ],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
- "chargeBoxID": {
- "$ref": "#/components/schemas/ocppChargeBoxID"
- },
"args": {
"type": "object",
"properties": {

MODIFY
src/server/rest/v1/router/api/ChargingStationRouter.ts
src/server/rest/v1/router/api/ChargingStationRouter.ts
@@ -67,6 +67,7 @@ export default class ChargingStationRouter {
protected buildRouteChargingStationReset(): void {
this.router.put(`/${ServerRoute.REST_CHARGING_STATIONS_RESET}`, async (req: Request, res: Response, next: NextFunction) => {
+ req.body.chargeBoxID = req.params.id;
await RouterUtils.handleServerAction(ChargingStationService.handleAction.bind(this), ServerAction.CHARGING_STATION_RESET, req, res, next);
});
}

MODIFY
src/types/Server.ts
src/types/Server.ts
@@ -406,7 +406,7 @@ export enum ServerRoute {
REST_CHARGING_STATIONS = 'chargingstations',
REST_CHARGING_STATION = 'chargingstations/:id',
- REST_CHARGING_STATIONS_RESET = 'chargingstations/reset',
+ REST_CHARGING_STATIONS_RESET = 'chargingstations/:id/reset',
REST_CHARGING_STATIONS_CACHE_CLEAR = 'chargingstations/:id/cache/clear',
REST_CHARGING_STATIONS_RETRIEVE_CONFIGURATION = 'chargingstations/:id/configuration/retrieve',
REST_CHARGING_STATIONS_REMOTE_START = 'chargingstations/:id/remote/start',

Added id on reset route