From 52d40796e92871c9e0fdeca28cdfdef251ec4bfd Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Wed, 24 May 2023 22:42:38 +0000 Subject: [PATCH] fix bugs in utils.js Signed-off-by: Arthur Lu --- utils.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/utils.js b/utils.js index ad1c34e..eac37df 100644 --- a/utils.js +++ b/utils.js @@ -42,15 +42,12 @@ export async function approveResources(req, username, request) { let avail = (await getUserResources(req, username)).avail; Object.keys(request).forEach((key) => { if (!(key in avail)) { // if requested resource is not in avail, block - approved = false; return false; } else if (isNaN(avail[key]) || isNaN(request[key])) { // if either the requested or avail resource is NaN, block - approved = false; return false; } else if (avail[key] - request[key] < 0) { // if the avail resources is less than the requested resources, block - approved = false; return false; } });