From 385a4a5730252c8c0886a09d505869a6c79a5217 Mon Sep 17 00:00:00 2001 From: Ty Eggen Date: Sun, 29 Dec 2024 23:55:35 +0000 Subject: [PATCH] fix(server): deleteTerminal issue --- server/lib/stores/terminals/index.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/server/lib/stores/terminals/index.js b/server/lib/stores/terminals/index.js index 1ac6375..3f93e89 100644 --- a/server/lib/stores/terminals/index.js +++ b/server/lib/stores/terminals/index.js @@ -217,13 +217,14 @@ TerminalStore.prototype.getTerminalDetails = async function (terminalId) { } TerminalStore.prototype.deleteTerminal = async function (terminalId) { - const terminalResult = await this.terminals - .chain() - .find({ id: { $eq: terminalId } }) - .remove() - .data() + try { + await this.terminals.delete({ where: { id: terminalId } }) + return true + } catch (err) { + console.error(err) - return terminalResult.length === 0 + return false + } } TerminalStore.prototype.checkTerminalExists = async function (terminalId) {