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 6ab48a5a
authored
2024-05-22 11:56:30 +0530
by
jaymehta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
.
1 parent
f8899608
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
src/api/experience/controllers/experience.js
src/api/experience/controllers/experience.js
View file @
6ab48a5
...
@@ -110,6 +110,27 @@ module.exports = createCoreController("api::experience.experience", () => ({
...
@@ -110,6 +110,27 @@ module.exports = createCoreController("api::experience.experience", () => ({
// if (!ctx.request.body.data.vendor) {
// if (!ctx.request.body.data.vendor) {
// throw new ValidationError("Vendor is a mandatory field.");
// 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
);
console
.
log
(
"ctx>"
,
ctx
.
request
.
body
);
if
(
!
ctx
.
request
.
body
.
data
.
pincode
)
{
if
(
!
ctx
.
request
.
body
.
data
.
pincode
)
{
throw
new
ValidationError
(
"Pincode is a mandatory field."
);
throw
new
ValidationError
(
"Pincode is a mandatory field."
);
...
...
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