From f0816d4fbaf24acf697e640092475b36a178efeb Mon Sep 17 00:00:00 2001 From: "J. Zane Cook" <90814067+jzanecook@users.noreply.github.com> Date: Mon, 27 Nov 2023 16:04:41 -0600 Subject: [PATCH] fix(js-sdk): Enforcing type of task --- packages/sdk/js/package-lock.json | 4 ++-- packages/sdk/js/src/agent.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/sdk/js/package-lock.json b/packages/sdk/js/package-lock.json index 664a77b..1cddbc4 100644 --- a/packages/sdk/js/package-lock.json +++ b/packages/sdk/js/package-lock.json @@ -1,12 +1,12 @@ { "name": "agent-protocol", - "version": "1.0.0", + "version": "1.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "agent-protocol", - "version": "1.0.0", + "version": "1.0.2", "license": "MIT", "dependencies": { "@types/uuid": "^9.0.2", diff --git a/packages/sdk/js/src/agent.ts b/packages/sdk/js/src/agent.ts index 6517430..a1b8d36 100644 --- a/packages/sdk/js/src/agent.ts +++ b/packages/sdk/js/src/agent.ts @@ -367,8 +367,8 @@ const registerCreateArtifact: RouteRegisterFn = (router: Router, context: RouteC const relativePath = req.body.relative_path const task = tasks.find(([{ task_id }]) => task_id == taskId) - if (!task) { - res + if (task === undefined) { + return res .status(404) .json({ message: 'Unable to find task with the provided id' }) }