Skip to content

Commit

Permalink
fix(server): deleteTerminal issue
Browse files Browse the repository at this point in the history
  • Loading branch information
TyIsI committed Dec 29, 2024
1 parent 409b70f commit 385a4a5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions server/lib/stores/terminals/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 385a4a5

Please sign in to comment.