Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jay Mehta
/
zango-strapi
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Registry
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 73e1c43a
authored
11 months ago
by
jaymehta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
update image query
1 parent
3440fe10
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
src/api/experience/controllers/experience.js
src/api/experience/controllers/experience.js
View file @
73e1c43
...
...
@@ -66,7 +66,7 @@ module.exports = createCoreController("api::experience.experience", () => ({
finalImageArray
=
[...
finalImageArray
,
{
image
:
element
}];
}
ctx
.
request
.
body
.
data
.
imagesComponent
;
//
ctx.request.body.data.imagesComponent;
// Create Activity
const
activity
=
await
strapi
.
entityService
.
create
(
"api::experience.experience"
,
...
...
@@ -157,7 +157,15 @@ module.exports = createCoreController("api::experience.experience", () => ({
throw
new
ValidationError
(
"Category is a mandatory field"
);
}
console
.
log
(
"subcategoyr"
,
ctx
.
params
);
let
finalImageArray
=
[];
for
(
let
index
=
0
;
index
<
ctx
.
request
.
body
.
data
.
imagesComponent
.
length
;
index
++
)
{
const
element
=
ctx
.
request
.
body
.
data
.
imagesComponent
[
index
];
finalImageArray
=
[...
finalImageArray
,
{
image
:
element
}];
}
const
subCategory
=
await
strapi
.
query
(
"api::sub-categorie.sub-categorie"
)
.
findOne
({
...
...
@@ -217,6 +225,7 @@ module.exports = createCoreController("api::experience.experience", () => ({
approved
:
ctx
.
request
.
body
.
data
.
approved
,
// imagesComponent: ctx.request.body.data.imagesArrayComponent,
...
ctx
.
request
.
body
.
data
.
daysBoolean
,
imagesComponent
:
finalImageArray
,
},
});
console
.
log
(
...
...
@@ -229,13 +238,13 @@ module.exports = createCoreController("api::experience.experience", () => ({
// ? ctx.request.body.data.imagesArrayComponent
// : [ctx.request.body.data.imagesArrayComponent];
// console.log("imagesComponentData >", imagesComponentData);
const
updatedExperienceImageComponent
=
await
strapi
.
entityService
.
update
(
"api::experience.experience"
,
id
,
{
data
:
{
imagesComponent
:
ctx
.
request
.
body
.
data
.
imagesComponent
},
}
);
//
const updatedExperienceImageComponent = await strapi.entityService.update(
//
"api::experience.experience",
//
id,
//
{
//
data: { imagesComponent: ctx.request.body.data.imagesComponent },
//
}
//
);
console
.
log
(
"updatedExperience"
,
updatedExperience
);
ctx
.
send
({
success
:
true
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment