Commit 6ab48a5a by jaymehta

.

1 parent f8899608
......@@ -110,6 +110,27 @@ module.exports = createCoreController("api::experience.experience", () => ({
// if (!ctx.request.body.data.vendor) {
// throw new ValidationError("Vendor is a mandatory field.");
// }
if (
ctx.request.body.data.approved == "approved" ||
ctx.request.body.data.approved == "rejected"
) {
const updatedExperience = await strapi
.query("api::experience.experience")
.update({
where: { id },
data: {
approved: ctx.request.body.data.approved,
},
});
console.log("updatedExperience", updatedExperience);
ctx.send({
success: true,
message: "Status updated",
data: {
...updatedExperience,
},
});
}
console.log("ctx>", ctx.request.body);
if (!ctx.request.body.data.pincode) {
throw new ValidationError("Pincode is a mandatory field.");
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!