From 6d1dc5611d001d4871098f4665df8f8bd728f111 Mon Sep 17 00:00:00 2001 From: varun Date: Thu, 23 Feb 2023 05:07:16 -0500 Subject: [PATCH] made update tank levels api hit automatically when get tank levels called --- src/controllers/tanksController.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index d1a18623..b832b4dc 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -4,6 +4,7 @@ const boom = require("boom"); const fastify = require("fastify")({ logger: true, }); +const tanksController = require("./tanksController") @@ -179,6 +180,7 @@ exports.updateTanklevels = async (req, reply) => { exports.getTanklevels = async (req, reply) => { try { const customerId = req.params.customerId; + await tanksController.updateTanklevels(req) const updated_data = await Tank.find({ customerId: customerId });