From 5446038ed79c8a7b9f0d48777f48df7fa66ccac9 Mon Sep 17 00:00:00 2001 From: Fredrik Oseberg Date: Mon, 9 Aug 2021 14:37:46 +0200 Subject: [PATCH] feat: add update health endpoint --- src/lib/db/project-store.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/db/project-store.ts b/src/lib/db/project-store.ts index bcea7cc15f..350d596996 100644 --- a/src/lib/db/project-store.ts +++ b/src/lib/db/project-store.ts @@ -51,6 +51,12 @@ class ProjectStore { return rows.map(this.mapRow); } + async updateHealth(healthUpdate: IProjectHealthUpdate): Promise { + await this.db(TABLE) + .where({ id: healthUpdate.id }) + .update({ health: healthUpdate.health }); + } + async get(id: string): Promise { return this.db .first(COLUMNS)