fix bug in create disk resource allocation

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
Arthur Lu 2023-04-11 21:57:14 +00:00
parent b77850bad6
commit 943d598b69

View File

@ -231,7 +231,7 @@ app.post("/api/disk/create", async (req, res) => {
// check resource allocation
let request = {};
if (!req.body.disk.includes("ide")) {
request[req.body.storage] = Number(req.body.siz); // setup request object
request[req.body.storage] = Number(req.body.size); // setup request object
if (!requestResources(req.cookies.username, request)) { // check request approval
res.status(500).send({auth: auth, data:{request: request, error: `Storage ${storage} could not fulfill request of size ${req.body.size}G.`}});
return;