pledge4future/WePledge

Error on commuting emission with train transportation mode

Opened this issue · 1 comments

The following errors can occur when creating a commuting entry:

When trying to create an entry with transportation type Train and fuelType electricity the backend returns this error:

[
    {
        "message": "index 0 is out of bounds for axis 0 with size 0",
        "locations": [
            {
                "line": 2,
                "column": 3
            }
        ],
        "path": [
            "createCommuting"
        ]
    }
]

The variables of the request are:

{
    "transportationMode": "Train",
    "fuelType": "electricity",
    "passengers": 1,
    "distance": 30,
    "size": "",
    "workweeks": 46,
    "fromTimestamp": "2021-02-01",
    "toTimestamp": "2021-03-01"
}

The same does occur for the transportation mode bus