tc_devices expirationtime is reset to null from API

mbodea2007 2 years ago

Hello,

after calling the API to Update a Device on /api/devices/{id} , the db column expirationtime on tc_devices is reset to NULL.
(It works OK on /api/devices/{id}/accumulators ).
Thx.
Marius

Anton Tananaev 2 years ago

You probably passed expirationtime as NULL in your API request.

mbodea2007 2 years ago

I am not passing expirationtime at all, because it is not part of the Device object.
Thx

Anton Tananaev 2 years ago

You're mistaken.

mbodea2007 2 years ago

The device object, according to API docs is:

[
  {
    "id": 0,
    "name": "string",
    "uniqueId": "string",
    "status": "string",
    "disabled": true,
    "lastUpdate": "2019-08-24T14:15:22Z",
    "positionId": 0,
    "groupId": 0,
    "phone": "string",
    "model": "string",
    "contact": "string",
    "category": "string",
    "attributes": {}
  }
]

there is a lastupdate, but not an expirationtime...
Thx

Anton Tananaev 2 years ago

We probably haven't updated the documentation when it was added. Feel free to send a pull request.

mbodea2007 2 years ago

Indeed.
The API docs is probably outdated.
The pull request shows all Device properties.
Problem fixed.
Thx.