Commit 3b09045f by jaymehta

.

1 parent 4226ff54
...@@ -57,7 +57,7 @@ module.exports = createCoreController("api::experience.experience", () => ({ ...@@ -57,7 +57,7 @@ module.exports = createCoreController("api::experience.experience", () => ({
); );
} }
let finalImageArray = []; let finalImageArray = [];
for ( for (
let index = 0; let index = 0;
index < ctx.request.body.data.imagesComponent.length; index < ctx.request.body.data.imagesComponent.length;
...@@ -66,7 +66,7 @@ module.exports = createCoreController("api::experience.experience", () => ({ ...@@ -66,7 +66,7 @@ module.exports = createCoreController("api::experience.experience", () => ({
const element = ctx.request.body.data.imagesComponent[index]; const element = ctx.request.body.data.imagesComponent[index];
console.log("here >", element); console.log("here >", element);
finalImageArray = [...finalImageArray, { image: element }]; finalImageArray = [...finalImageArray, { image: element }];
console.log("final array", finalImageArray) console.log("final array", finalImageArray);
} }
// ctx.request.body.data.imagesComponent; // ctx.request.body.data.imagesComponent;
...@@ -106,7 +106,7 @@ module.exports = createCoreController("api::experience.experience", () => ({ ...@@ -106,7 +106,7 @@ module.exports = createCoreController("api::experience.experience", () => ({
contactPersonForBooking: contactPersonForBooking:
ctx.request.body.data.contactPersonForBooking, ctx.request.body.data.contactPersonForBooking,
approved: ctx.request.body.data.approved, approved: ctx.request.body.data.approved,
imagesComponent: ctx.request.body.data.imagesComponent, imagesComponent: finalImageArray,
// imagesComponent: finalImageArray, // imagesComponent: finalImageArray,
...ctx.request.body.data.daysBoolean, ...ctx.request.body.data.daysBoolean,
}, },
...@@ -173,9 +173,9 @@ module.exports = createCoreController("api::experience.experience", () => ({ ...@@ -173,9 +173,9 @@ module.exports = createCoreController("api::experience.experience", () => ({
index++ index++
) { ) {
const element = ctx.request.body.data.imagesComponent[index]; const element = ctx.request.body.data.imagesComponent[index];
console.log("element", element) console.log("element", element);
finalImageArray = [...finalImageArray, { image: element }]; finalImageArray = [...finalImageArray, { image: element }];
console.log("final", finalImageArray) console.log("final", finalImageArray);
} }
const subCategory = await strapi const subCategory = await strapi
.query("api::sub-categorie.sub-categorie") .query("api::sub-categorie.sub-categorie")
...@@ -236,7 +236,7 @@ module.exports = createCoreController("api::experience.experience", () => ({ ...@@ -236,7 +236,7 @@ module.exports = createCoreController("api::experience.experience", () => ({
approved: ctx.request.body.data.approved, approved: ctx.request.body.data.approved,
// imagesComponent: ctx.request.body.data.imagesArrayComponent, // imagesComponent: ctx.request.body.data.imagesArrayComponent,
...ctx.request.body.data.daysBoolean, ...ctx.request.body.data.daysBoolean,
imagesComponent: finalImageArray, imagesComponent: ctx.request.body.data.imagesComponent,
}, },
}); });
console.log( console.log(
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!