made changes in add tanks added installer id

master
varun 1 year ago
parent bcaed8bac0
commit a01b4bdfc3

@ -91,8 +91,8 @@ exports.addTanks = async (req, reply) => {
const customerId = req.params.customerId;
const { hardwareId, tankhardwareId,tankName,tankLocation } = req.body;
const InstallerId = req.params.InstallerId;
const { customerId,hardwareId, tankhardwareId,tankName,tankLocation } = req.body;
// Check if the combination of hardwareId and tankhardwareId already exists
@ -109,6 +109,7 @@ exports.addTanks = async (req, reply) => {
}
const tankData = {
InstallerId:InstallerId,
customerId: customerId,
hardwareId: hardwareId,
tankhardwareId: tankhardwareId,

@ -33,7 +33,7 @@ const RoleSchema = new Schema({ name: String });
const tanksSchema = new mongoose.Schema({
hardwareId: { type: String },
InstallerId: { type: String, default: null },
tankhardwareId: { type: String },
hardwareId_type: { type: String },
hardwareId_company: { type: String },

@ -6,18 +6,18 @@ module.exports = function (fastify, opts, next) {
fastify.route({
method: "POST",
url: "/api/addTanks/:customerId",
url: "/api/addTanks/:InstallerId",
schema: {
tags: ["Tank"],
description: "This is for cretae New Tank",
summary: "This is for Create New Tank.",
params: {
required: ["customerId"],
required: ["InstallerId"],
type: "object",
properties: {
customerId: {
InstallerId: {
type: "string",
description: "customerId",
description: "InstallerId",
},
},
},
@ -29,7 +29,7 @@ module.exports = function (fastify, opts, next) {
tankName: { type: "string" },
blockName: { type: "string"},
capacity: { type: "string" },
customerId: { type: "string" },
typeOfWater: { type: "string" },
waterCapacityPerCm:{ type: "string" },
tankLocation: { type: "string" },

Loading…
Cancel
Save