demo-deploy
This commit is contained in:
parent
8263b0a684
commit
9d23be1385
2
.env
2
.env
@ -2,7 +2,7 @@
|
||||
|
||||
DB_URL="mongodb+srv://projectboloai:kNe1zksKjiIrnJjV@cluster0.r7lfhbq.mongodb.net/?retryWrites=true&w=majority"
|
||||
|
||||
PORT = 5000
|
||||
PORT = 8000
|
||||
JWT_SECRET = jdvnvjwrniwj4562jn6@1xsbfeh@wre4Njdf;
|
||||
|
||||
|
||||
|
1820
package-lock.json
generated
1820
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -26,6 +26,7 @@
|
||||
"multer": "^1.4.5-lts.1",
|
||||
"multer-storage-cloudinary": "^4.0.0",
|
||||
"nodemailer": "^6.9.4",
|
||||
"nodemon": "^3.0.1",
|
||||
"secure-random-password": "^0.2.3",
|
||||
"validator": "^13.7.0"
|
||||
}
|
||||
|
@ -10,12 +10,15 @@ import catchAsyncErrors from "../../middlewares/catchAsyncErrors.js";
|
||||
import sendToken from "../../Utils/jwtToken.js";
|
||||
import ErrorHander from "../../Utils/errorhander.js";
|
||||
|
||||
|
||||
|
||||
|
||||
export const createBusiness = async (req, res) => {
|
||||
try {
|
||||
if (!req?.user) return res.status(400).json({ message: "please login !" });
|
||||
|
||||
const {
|
||||
business,
|
||||
userType,
|
||||
specialization,
|
||||
country,
|
||||
language,
|
||||
@ -24,7 +27,7 @@ export const createBusiness = async (req, res) => {
|
||||
address_Line_1,
|
||||
address_Line_2,
|
||||
pincode,
|
||||
business_name,
|
||||
userName,
|
||||
email,
|
||||
contact_Number,
|
||||
contact_Person_Name,
|
||||
@ -33,10 +36,10 @@ export const createBusiness = async (req, res) => {
|
||||
} = req.body;
|
||||
//validation
|
||||
switch (true) {
|
||||
case !business:
|
||||
case !userType:
|
||||
return res.status(500).send({ error: "Business is Required" });
|
||||
case !language:
|
||||
return res.status(500).send({ error: "Language is Required" });
|
||||
// case !language:
|
||||
// return res.status(500).send({ error: "Language is Required" });
|
||||
case !address_Line_1:
|
||||
return res.status(500).send({ error: "address_Line_1 is Required" });
|
||||
case !address_Line_2:
|
||||
@ -134,6 +137,22 @@ export const createBusiness = async (req, res) => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getAllBusiness = async (req, res) => {
|
||||
try {
|
||||
if (!req?.user) return res.status(400).json({ message: "please login !" });
|
||||
|
@ -10,16 +10,17 @@ const { Schema, model } = mongoose;
|
||||
|
||||
const BusinessSchema = new Schema(
|
||||
{
|
||||
business: { type: String, required: true },
|
||||
userType: { type: String, required: true },
|
||||
|
||||
specialization: {
|
||||
type: String,
|
||||
},
|
||||
|
||||
language: [{ type: Array, default: [], required: true }],
|
||||
language: [{ type: Array, default: [] }],
|
||||
//contacts
|
||||
business_name: {
|
||||
userName: {
|
||||
type: String,
|
||||
required:true
|
||||
},
|
||||
email: {
|
||||
type: String,
|
||||
@ -32,7 +33,7 @@ const BusinessSchema = new Schema(
|
||||
},
|
||||
|
||||
contact_Number: { type: Number, required: true },
|
||||
contact_Person_Name: { type: String, required: true },
|
||||
contact_Person_Name: { type: String},
|
||||
|
||||
url: { type: String, default: "" },
|
||||
short_url: { type: String, default: "" },
|
||||
@ -50,7 +51,7 @@ const BusinessSchema = new Schema(
|
||||
added_by: {
|
||||
type: mongoose.Schema.ObjectId,
|
||||
ref: "User",
|
||||
required: true,
|
||||
|
||||
},
|
||||
},
|
||||
{ timestamps: true }
|
||||
|
@ -15,7 +15,7 @@ cloudinary.config({
|
||||
api_key: process.env.CLOUDINARY_API_KEY,
|
||||
api_secret: process.env.CLOUDINARY_API_SECRET,
|
||||
});
|
||||
//<---------deployement------------->
|
||||
//<---------deployement------------->``
|
||||
// const data_dir = path.resolve();
|
||||
|
||||
// if (process.env.NODE_ENV === "production") {
|
||||
|
Loading…
Reference in New Issue
Block a user