Merge branch 'master' of http://128.199.30.231/possibillion/smellika-api
This commit is contained in:
commit
d0cf999ebe
@ -1,5 +1,6 @@
|
||||
import { shippingAddress } from "./ShippingAddressModel.js";
|
||||
export const AddshippingAddress = async (req, res) => {
|
||||
// console.log("request came here");
|
||||
try {
|
||||
const {
|
||||
first_Name,
|
||||
@ -11,6 +12,8 @@ export const AddshippingAddress = async (req, res) => {
|
||||
postalCode,
|
||||
country,
|
||||
} = req.body;
|
||||
|
||||
// console.log(req.body);
|
||||
switch (true) {
|
||||
//validation
|
||||
case !first_Name: {
|
||||
@ -47,6 +50,7 @@ export const AddshippingAddress = async (req, res) => {
|
||||
message: "shipping Address Added",
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error.message);
|
||||
res.status(500).json({
|
||||
success: false,
|
||||
message: error.message ? error.message : "Something went Wrong",
|
||||
|
@ -38,6 +38,14 @@ const shippingAddressSchema = new mongoose.Schema(
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
company_name: {
|
||||
type: String,
|
||||
maxLength: [70, "name cannot exceed 70 characters"],
|
||||
},
|
||||
gst_number: {
|
||||
type: Number,
|
||||
maxLength: [15, "name cannot exceed 15 characters"],
|
||||
},
|
||||
default: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
|
Loading…
Reference in New Issue
Block a user