tc_devices expirationtime is reset to null from API

mbodea2007a year 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 Tananaeva year ago

You probably passed expirationtime as NULL in your API request.

mbodea2007a year ago

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

Anton Tananaeva year ago

You're mistaken.

mbodea2007a year 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 Tananaeva year ago

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

mbodea2007a year ago

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