Fix oversight in commit 58488eb
This commit is contained in:
1 parent
35b193f058
commit
39bb937f9d
1 file changed
+4
-4
+4
-4
@@ -93,8 +93,8 @@ router.get(`/devices/:id.csv`, async (ctx) => {
|
|||||||
return void (ctx.status = 403);
|
return void (ctx.status = 403);
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await db.query("devices", filter);
|
const { value: device } = await db.query("devices", filter).next();
|
||||||
if (!res[0]) return void (ctx.status = 404);
|
if (!device) return void (ctx.status = 404);
|
||||||
|
|
||||||
ctx.type = "text/csv";
|
ctx.type = "text/csv";
|
||||||
ctx.attachment(
|
ctx.attachment(
|
||||||
@@ -108,8 +108,8 @@ router.get(`/devices/:id.csv`, async (ctx) => {
|
|||||||
"Parameter,Object,Object timestamp,Writable,Writable timestamp,Value,Value type,Value timestamp,Notification,Notification timestamp,Access list,Access list timestamp\n"
|
"Parameter,Object,Object timestamp,Writable,Writable timestamp,Value,Value type,Value timestamp,Notification,Notification timestamp,Access list,Access list timestamp\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
for (const k of Object.keys(res[0]).sort()) {
|
for (const k of Object.keys(device).sort()) {
|
||||||
const p = res[0][k];
|
const p = device[k];
|
||||||
let value = "";
|
let value = "";
|
||||||
let type = "";
|
let type = "";
|
||||||
if (p.value) {
|
if (p.value) {
|
||||||
|
|||||||
Reference in new issue
Block a user