File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,17 @@ const ProductSchema = new mongoose.Schema(
1717 maxLength : 400 ,
1818 required : true ,
1919 } ,
20- size :{
21- type :Array
20+ size : {
21+ type : Array ,
22+ required : true ,
2223 } ,
23- color :{
24- type :Array
24+ color : {
25+ type : Array ,
26+ required : true ,
2527 } ,
2628 imgUrl : {
2729 type : String ,
30+ required : true ,
2831 } ,
2932 tags : {
3033 type : [
Original file line number Diff line number Diff line change @@ -52,10 +52,12 @@ async function signIn(user) {
5252}
5353
5454async function checkLength ( item , num ) {
55- if ( item . lenght >= num ) {
55+ if ( item . length >= num ) {
5656 return true ;
5757 } else {
58- throw new BadRequestError ( `the minimum allowed is ${ num } ` ) ;
58+ throw new BadRequestError (
59+ `${ item } is too short, the minimum allowed is ${ num } ` ,
60+ ) ;
5961 }
6062}
6163
You can’t perform that action at this time.
0 commit comments