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 9ac2ea61
authored
2024-05-06 12:45:55 +0530
by
jaymehta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix
1 parent
d211e8ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
src/api/experience/controllers/experience.js
src/api/experience/controllers/experience.js
View file @
9ac2ea6
...
...
@@ -106,9 +106,10 @@ module.exports = createCoreController("api::experience.experience", () => ({
},
async
update
(
ctx
)
{
if
(
!
ctx
.
request
.
body
.
data
.
vendor
)
{
throw
new
ValidationError
(
"Vendor is a mandatory field."
);
}
// if (!ctx.request.body.data.vendor) {
// throw new ValidationError("Vendor is a mandatory field.");
// }
console
.
log
(
"ctx>"
,
ctx
.
request
.
body
);
if
(
!
ctx
.
request
.
body
.
data
.
pincode
)
{
throw
new
ValidationError
(
"Pincode is a mandatory field."
);
}
...
...
@@ -118,6 +119,8 @@ module.exports = createCoreController("api::experience.experience", () => ({
if
(
!
ctx
.
request
.
body
.
data
.
category
)
{
throw
new
ValidationError
(
"Category is a mandatory field"
);
}
console
.
log
(
"subcategoyr"
,
ctx
.
request
.
body
.
data
.
subCategory
);
const
subCategory
=
await
strapi
.
query
(
"api::sub-categorie.sub-categorie"
)
.
findOne
({
...
...
@@ -127,7 +130,6 @@ module.exports = createCoreController("api::experience.experience", () => ({
},
},
});
const
category
=
await
strapi
.
query
(
"api::categorie.categorie"
).
findOne
({
where
:
{
name
:
{
...
...
@@ -157,7 +159,7 @@ module.exports = createCoreController("api::experience.experience", () => ({
activityType
:
ctx
.
request
.
body
.
data
.
activityType
,
link
:
ctx
.
request
.
body
.
data
.
link
,
cancellationPolicy
:
ctx
.
request
.
body
.
data
.
cancellationPolicy
,
vendor
:
ctx
.
request
.
body
.
data
.
vendor
.
id
,
//
vendor: ctx.request.body.data.vendor.id,
subCategory
:
subCategory
.
id
,
category
:
category
.
id
,
giftSomeone
:
ctx
.
request
.
body
.
data
.
giftSomeone
,
...
...
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