샵 업로드
This commit is contained in:
parent
7a6fd2309b
commit
cdde700734
@ -291,25 +291,25 @@ const createShopByUser = async (req, res) => {
|
|||||||
const { logo, cover, ...others } = req.body;
|
const { logo, cover, ...others } = req.body;
|
||||||
const logoBlurDataURL = await getBlurDataURL(logo?.url);
|
const logoBlurDataURL = await getBlurDataURL(logo?.url);
|
||||||
const coverBlurDataURL = await getBlurDataURL(cover?.url);
|
const coverBlurDataURL = await getBlurDataURL(cover?.url);
|
||||||
// const shop = user?.shop ? await Shop.findById(user?.shop.toString()) : null;
|
const shop = user?.shop ? await Shop.findById(user?.shop.toString()) : null;
|
||||||
// if (shop) {
|
if (shop) {
|
||||||
// await Shop.findByIdAndUpdate(shop._id, {
|
await Shop.findByIdAndUpdate(shop._id, {
|
||||||
// ...others,
|
...others,
|
||||||
// logo: {
|
logo: {
|
||||||
// ...logo,
|
...logo,
|
||||||
// blurDataURL: logoBlurDataURL,
|
blurDataURL: logoBlurDataURL,
|
||||||
// },
|
},
|
||||||
// cover: {
|
cover: {
|
||||||
// ...cover,
|
...cover,
|
||||||
// blurDataURL: coverBlurDataURL,
|
blurDataURL: coverBlurDataURL,
|
||||||
// },
|
},
|
||||||
// status: 'pending',
|
status: 'pending',
|
||||||
// });
|
});
|
||||||
// return res.status(200).json({
|
return res.status(200).json({
|
||||||
// success: true,
|
success: true,
|
||||||
// message: 'Shop updated',
|
message: 'Shop updated',
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
const createdShop = await Shop.create({
|
const createdShop = await Shop.create({
|
||||||
vendor: user._id.toString(),
|
vendor: user._id.toString(),
|
||||||
...others,
|
...others,
|
||||||
|
Loading…
Reference in New Issue
Block a user