Commit e4d313e5 by jaymehta

.

1 parent d3892d59
......@@ -40,7 +40,7 @@ module.exports = createCoreController("api::vendor.vendor", () => ({
},
});
// Check if its already existing in vendor entity
console.log("currentUser", currentUser);
console.log("here ctx.request.body", ctx.request.body);
console.log(
"phoneNumber",
ctx.request.body.data.mobileNo,
......@@ -79,8 +79,11 @@ module.exports = createCoreController("api::vendor.vendor", () => ({
console.log("ctx.request.body.data", ctx.request.body.data);
console.log("existingUser", existingUser);
if (existingUser) {
if (existingUser && existingUser.length !== 0) {
console.log("should be here");
} else {
console.log("but is here");
ctx.request.body.data.user = currentUser.id;
const response = await strapi.entityService.create("api::vendor.vendor", {
data: {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!