feat: Add size attribute to farm
This commit is contained in:
@@ -5,11 +5,12 @@ const Finance = require("../Models/finance.model.js");
|
|||||||
// Create a farm
|
// Create a farm
|
||||||
const createFarm = async (req, res) => {
|
const createFarm = async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const { name, location, waterContent, soilType } = req.body;
|
const { name, location, waterContent, soilType, size } = req.body;
|
||||||
|
|
||||||
const farm = new Farm({
|
const farm = new Farm({
|
||||||
name,
|
name,
|
||||||
location,
|
location,
|
||||||
|
size,
|
||||||
waterContent,
|
waterContent,
|
||||||
soilType,
|
soilType,
|
||||||
owner: req.user._id,
|
owner: req.user._id,
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ const farmSchema = new mongoose.Schema(
|
|||||||
ref: "User",
|
ref: "User",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
size: { type: String },
|
||||||
waterContent: { type: String, required: true },
|
waterContent: { type: String, required: true },
|
||||||
soilType: { type: String, required: true },
|
soilType: { type: String, required: true },
|
||||||
fertilizer: [
|
fertilizer: [
|
||||||
|
|||||||
Reference in New Issue
Block a user