From a5bbe6208a700b7d8b9acef0b769364e31fa0fa6 Mon Sep 17 00:00:00 2001 From: benbot Date: Tue, 21 Nov 2023 10:38:28 -0500 Subject: [PATCH] fixed a package.json issue and some spell typing weirdnes --- packages/client/providers/package.json | 2 +- packages/server/core/src/services/agents/agents.class.ts | 8 ++++---- packages/server/core/src/services/spells/spells.class.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/client/providers/package.json b/packages/client/providers/package.json index 34648cc438..96c079c16e 100644 --- a/packages/client/providers/package.json +++ b/packages/client/providers/package.json @@ -11,7 +11,7 @@ "react-redux": "8.0.5", "vite": "^4.4.9", "@nx/vite": "^16.7.4", - "vite-plugin-dts": "^2.3.0", + "vite-plugin-dts": "^2.3.0" }, "main": "./index.js", "module": "./index.mjs", diff --git a/packages/server/core/src/services/agents/agents.class.ts b/packages/server/core/src/services/agents/agents.class.ts index 934c6f53f5..2a3ca60674 100644 --- a/packages/server/core/src/services/agents/agents.class.ts +++ b/packages/server/core/src/services/agents/agents.class.ts @@ -33,11 +33,11 @@ export class AgentService< async get(agentId: string, params: ServiceParams) { const db = app.get('dbClient') - const { currentReleaseVersion } = params.query + const currentReleaseVersionId = params.query?.currentReleaseVersionId const query = super.createQuery(params) - if (agentId && !currentReleaseVersion) { + if (agentId && !currentReleaseVersionId) { const count = await db('agentReleases').count('*').as('count').where('agent_id', '=', agentId) if (count["count"] > 0) { @@ -47,11 +47,11 @@ export class AgentService< }) } - } else if(agentId && currentReleaseVersion) { + } else if(agentId && currentReleaseVersionId) { query .leftJoin('agentRelease as releases', function() { - this.on('agents.id', '=', 'agentReleases.agentId').andOn(currentReleaseVersion, '=', 'agentReleases.releaseVersion') + this.on('agents.id', '=', 'agentReleases.agentId').andOn(currentReleaseVersionId, '=', 'agentReleases.releaseVersion') }) } diff --git a/packages/server/core/src/services/spells/spells.class.ts b/packages/server/core/src/services/spells/spells.class.ts index db09888a68..f393932349 100644 --- a/packages/server/core/src/services/spells/spells.class.ts +++ b/packages/server/core/src/services/spells/spells.class.ts @@ -33,7 +33,7 @@ export class SpellService< async get(spellId: string, params: ServiceParams) { const db = app.get('dbClient') - const { versionId } = params.query + const versionId = params.query?.versionId const query = super.createQuery(params)