Continue phase 2 device ops and dynamic QR lifecycle
This commit is contained in:
7
dist/shared/store/deviceConfigStore.js
vendored
7
dist/shared/store/deviceConfigStore.js
vendored
@ -81,6 +81,13 @@ export async function listDeviceConfigAcks(deviceId, limit = 50) {
|
||||
LIMIT $2`, [deviceId, Math.min(Math.max(limit, 1), 200)]);
|
||||
return rows.map(mapAck);
|
||||
}
|
||||
export async function getLatestDeviceConfigAck(deviceId) {
|
||||
const { rows } = await getPool().query(`SELECT * FROM device_config_acks
|
||||
WHERE device_id = $1
|
||||
ORDER BY acked_at DESC
|
||||
LIMIT 1`, [deviceId]);
|
||||
return rows[0] ? mapAck(rows[0]) : null;
|
||||
}
|
||||
export function toDeviceConfigPayload(config) {
|
||||
return { ...config };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user