#3, добавила товары в фикстуры

parent 767f569d
...@@ -31,6 +31,27 @@ db.once('open', async () => { ...@@ -31,6 +31,27 @@ db.once('open', async () => {
token: '' token: ''
}); });
const [category1, category2] = await Category.create({
title: "some category",
},{
title: "some category 2"
});
await Product.create({
author: user2._id,
category: category1._id,
title: 'some product',
description: 'some description for some product',
image: 'somePhoto.jpeg',
price: 222
},{
author: user1._id,
category: category2._id,
title: 'some product 2',
description: 'some description for some product 2',
image: 'somePhoto1.jpeg',
price: 154
});
db.close(); db.close();
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment