Merge branch 'main' into new-admin

This commit is contained in:
baldo 2022-08-02 15:27:04 +02:00
commit a87a8f7e70
140 changed files with 7615 additions and 9303 deletions
server

View file

@ -314,7 +314,7 @@ export function handleJSON<Response>(handler: () => Promise<Response>): RequestH
return (request, response) => {
handler()
.then(data => success(response, data || {}))
.catch(error => error(response, error));
.catch(e => error(response, e));
};
}
@ -322,6 +322,6 @@ export function handleJSONWithData<Response>(handler: (data: RequestData) => Pro
return (request, response) => {
handler(getData(request))
.then(data => success(response, data || {}))
.catch(error => error(response, error));
.catch(e => error(response, e));
};
}

View file

@ -36,12 +36,12 @@ const CONSTRAINTS = {
},
mac: {
type: 'string',
regex: /^([a-f0-9]{12}|([a-f0-9]{2}:){5}[a-f0-9]{2})$/i,
regex: /^([a-f0-9]{12}|([a-f0-9]{2}:){5}[a-f0-9]{2}|([a-f0-9]{2}-){5}[a-f0-9]{2})$/i,
optional: false
},
coords: {
type: 'string',
regex: /^([a-f0-9]{12}|([a-f0-9]{2}:){5}[a-f0-9]{2}|([a-f0-9]{2}-){5}[a-f0-9]{2})$/i,
regex: /^(-?[0-9]{1,3}(\.[0-9]{1,15})? -?[0-9]{1,3}(\.[0-9]{1,15})?)$/,
optional: true
},
monitoring: {