From d275abb31f05b84083bcad058dad74fc1b0183ff Mon Sep 17 00:00:00 2001 From: Redm4x <2829180+Redm4x@users.noreply.github.com> Date: Wed, 14 Feb 2024 17:21:15 -0500 Subject: [PATCH] Fix provider active lease graph + Bump api version --- api/package-lock.json | 4 ++-- api/package.json | 2 +- api/src/services/db/statsService.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/package-lock.json b/api/package-lock.json index e09957cf6..ba8bab3b8 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -1,12 +1,12 @@ { "name": "cloudmos-api", - "version": "2.14.4", + "version": "2.14.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "cloudmos-api", - "version": "2.14.4", + "version": "2.14.5", "license": "Apache-2.0", "dependencies": { "@akashnetwork/akashjs": "0.5.0", diff --git a/api/package.json b/api/package.json index bb4ea219a..378f2aa57 100644 --- a/api/package.json +++ b/api/package.json @@ -1,6 +1,6 @@ { "name": "cloudmos-api", - "version": "2.14.4", + "version": "2.14.5", "description": "Api providing data to the deploy tool", "author": "Cloudmos", "license": "Apache-2.0", diff --git a/api/src/services/db/statsService.ts b/api/src/services/db/statsService.ts index 3ef5aa612..a00224a47 100644 --- a/api/src/services/db/statsService.ts +++ b/api/src/services/db/statsService.ts @@ -225,7 +225,7 @@ export const getProviderActiveLeasesGraphData = async (providerAddress: string) `SELECT "date" AS date, COUNT(l."id") AS count FROM "day" d LEFT JOIN "lease" l - ON l."providerAddress" = ':providerAddress' + ON l."providerAddress" = :providerAddress AND l."createdHeight" <= d."lastBlockHeightYet" AND (l."closedHeight" IS NULL OR l."closedHeight" > d."lastBlockHeightYet") AND (l."predictedClosedHeight" IS NULL OR l."predictedClosedHeight" > d."lastBlockHeightYet")