However if I change this, I'm still getting a different error:
JSON object requested, multiple (or no) rows returned
The Device Type and Device Type Alias do get created, but after the request it tries to do another POST request to /device type with null as data, which seems to be the result of the return null in the useCreateDeviceType() function.
When I try to create new Device Type, I get the following error in the console:
TypeError: Cannot read properties of undefined (reading 'id')
This is probably due to: https://github.com/dcaputo-harmoni/open-balena-ui/blob/a464227e69f50524ce02a0e0c17b6af328cf4a28/src/lib/deviceType.js#L11 which i Think should be:
const deviceType = await dataProvider.create('device type', {data: data});
However if I change this, I'm still getting a different error:
JSON object requested, multiple (or no) rows returned
The Device Type and Device Type Alias do get created, but after the request it tries to do another POST request to
/device type
withnull
as data, which seems to be the result of thereturn null
in theuseCreateDeviceType()
function.