From d0eb86daa7ef148b884f01e681aa567c10252186 Mon Sep 17 00:00:00 2001 From: Axel Cocat Date: Thu, 20 Jan 2022 19:27:22 +0100 Subject: [PATCH] fix(index): fix realm in link to character when using a single realm --- src/armory/DataTablesSsp.ts | 2 ++ src/armory/controllers/IndexController.ts | 6 ++---- static/index.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/armory/DataTablesSsp.ts b/src/armory/DataTablesSsp.ts index 942385c..b3bb6af 100644 --- a/src/armory/DataTablesSsp.ts +++ b/src/armory/DataTablesSsp.ts @@ -4,6 +4,7 @@ import { Connection, RowDataPacket } from "mysql2/promise"; export interface IResult { recordsTotal: number; recordsFiltered: number; + draw: number; data: any[][]; } @@ -221,6 +222,7 @@ export class DataTablesSsp { return { recordsTotal, recordsFiltered, + draw: this.draw, data: rows, }; } diff --git a/src/armory/controllers/IndexController.ts b/src/armory/controllers/IndexController.ts index 4579c62..ebd5476 100644 --- a/src/armory/controllers/IndexController.ts +++ b/src/armory/controllers/IndexController.ts @@ -79,10 +79,8 @@ export class IndexController { const result = await ssp .where("`deleteInfos_Account` IS NULL") .run(); + (result as any).realm = realm.name; - res.json({ - draw: ssp.draw, - ...result, - }); + res.json(result); } } diff --git a/static/index.html b/static/index.html index 6db4b3f..79daf1b 100644 --- a/static/index.html +++ b/static/index.html @@ -43,7 +43,7 @@ columnDefs: [ { targets: 0, - render: name => `${name}`, + render: (name, type, row, meta) => `${name}`, }, { searchable: false,