changes in get connections

master
varun 1 year ago
parent a00a33c6a8
commit 09962b330c

@ -172,15 +172,13 @@ exports.deleteTanksInfo = async (req, reply) => {
exports.getConnectionsInfoOfParticularTank = async (req, reply) => {
try {
const InstallerId = req.params.InstallerId;
const customerId = req.body.customerId;
const customerId = req.params.customerId;
const tankName = req.body.tankName;
const tankLocation = req.body.tankLocation.toLowerCase();
console.log(customerId, tankName, tankLocation);
// Find the specific tank
const mainTank = await Tank.findOne({
InstallerId:InstallerId,
tankName: tankName,
customerId: customerId,
tankLocation: tankLocation
@ -199,6 +197,7 @@ exports.getConnectionsInfoOfParticularTank = async (req, reply) => {
//get tanks data by passing username
exports.getTank = async (req, reply) => {
try {

@ -43,7 +43,7 @@ module.exports = function (fastify, opts, next) {
],
},
preHandler: fastify.auth([fastify.authenticate]),
// preHandler: fastify.auth([fastify.authenticate]),
handler: tanksController.addTanks,
// onResponse: (request, reply) => {
// validationHandler.sendPhoneVerificationCode(request, reply);
@ -140,17 +140,17 @@ module.exports = function (fastify, opts, next) {
fastify.route({
method: "PUT",
url: "/api/getConnectionsInfoOfParticularTank/:InstallerId",
url: "/api/getConnectionsInfoOfParticularTank/:customerId",
schema: {
tags: ["Tank"],
summary: "This is to get Connections Info Of ParticularTank",
params: {
required: ["InstallerId"],
required: ["customerId"],
type: "object",
properties: {
InstallerId: {
customerId: {
type: "string",
description: "InstallerId",
description: "customerId",
},
},
},
@ -159,7 +159,6 @@ module.exports = function (fastify, opts, next) {
type: "object",
// required: ['phone'],
properties: {
customerId: { type: "string", default: null },
tankName: {type: 'string'},
tankLocation: { type: "string", default: null },
@ -176,6 +175,7 @@ module.exports = function (fastify, opts, next) {
handler: tanksController.getConnectionsInfoOfParticularTank,
});
fastify.get("/api/getTanks", {

Loading…
Cancel
Save