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 26efc126
authored
2024-05-22 11:14:25 +0530
by
jaymehta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
changes
1 parent
bc6ae555
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
34 deletions
src/api/experience/controllers/experience.js
src/api/experience/controllers/experience.js
View file @
26efc12
...
...
@@ -110,13 +110,13 @@ module.exports = createCoreController("api::experience.experience", () => ({
// throw new ValidationError("Vendor is a mandatory field.");
// }
console
.
log
(
"ctx>"
,
ctx
.
request
.
body
);
if
(
!
ctx
.
request
.
body
.
data
.
pincode
)
{
if
(
!
ctx
.
request
.
body
.
data
.
data
.
pincode
)
{
throw
new
ValidationError
(
"Pincode is a mandatory field."
);
}
if
(
!
ctx
.
request
.
body
.
data
.
subCategory
)
{
if
(
!
ctx
.
request
.
body
.
data
.
data
.
subCategory
)
{
throw
new
ValidationError
(
"Subcategory is a mandatory field"
);
}
if
(
!
ctx
.
request
.
body
.
data
.
category
)
{
if
(
!
ctx
.
request
.
body
.
data
.
data
.
category
)
{
throw
new
ValidationError
(
"Category is a mandatory field"
);
}
console
.
log
(
"subcategoyr"
,
ctx
.
params
);
...
...
@@ -127,57 +127,57 @@ module.exports = createCoreController("api::experience.experience", () => ({
.
findOne
({
where
:
{
name
:
{
$eq
:
ctx
.
request
.
body
.
data
.
subCategory
,
$eq
:
ctx
.
request
.
body
.
data
.
data
.
subCategory
,
},
},
});
const
category
=
await
strapi
.
query
(
"api::categorie.categorie"
).
findOne
({
where
:
{
name
:
{
$eq
:
ctx
.
request
.
body
.
data
.
category
,
$eq
:
ctx
.
request
.
body
.
data
.
data
.
category
,
},
},
});
console
.
log
(
"ctx.request.body.data.activityId"
,
ctx
.
request
.
body
.
data
.
activityId
"ctx.request.body.data.
data.
activityId"
,
ctx
.
request
.
body
.
data
.
data
.
activityId
);
const
updatedExperience
=
await
strapi
.
query
(
"api::experience.experience"
)
.
update
(
{
id
},
{
name
:
ctx
.
request
.
body
.
data
.
name
,
description
:
ctx
.
request
.
body
.
data
.
description
,
pricePerPerson
:
ctx
.
request
.
body
.
data
.
pricePerPerson
,
address
:
ctx
.
request
.
body
.
data
.
address
,
masterPincode
:
ctx
.
request
.
body
.
data
.
pincode
.
id
,
minimumDuration
:
ctx
.
request
.
body
.
data
.
minimumDuration
,
maximumDuration
:
ctx
.
request
.
body
.
data
.
maximumDuration
,
duration
:
ctx
.
request
.
body
.
data
.
duration
,
ageLowerLimit
:
ctx
.
request
.
body
.
data
.
ageLowerLimit
,
ageNotes
:
ctx
.
request
.
body
.
data
.
ageNotes
,
phoneNumber
:
ctx
.
request
.
body
.
data
.
phoneNumber
,
minGroupSize
:
ctx
.
request
.
body
.
data
.
minGroupSize
,
maxGroupSize
:
ctx
.
request
.
body
.
data
.
maxGroupSize
,
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,
name
:
ctx
.
request
.
body
.
data
.
data
.
name
,
description
:
ctx
.
request
.
body
.
data
.
d
ata
.
d
escription
,
pricePerPerson
:
ctx
.
request
.
body
.
data
.
data
.
pricePerPerson
,
address
:
ctx
.
request
.
body
.
data
.
data
.
address
,
masterPincode
:
ctx
.
request
.
body
.
data
.
data
.
pincode
.
id
,
minimumDuration
:
ctx
.
request
.
body
.
data
.
data
.
minimumDuration
,
maximumDuration
:
ctx
.
request
.
body
.
data
.
data
.
maximumDuration
,
duration
:
ctx
.
request
.
body
.
data
.
d
ata
.
d
uration
,
ageLowerLimit
:
ctx
.
request
.
body
.
data
.
data
.
ageLowerLimit
,
ageNotes
:
ctx
.
request
.
body
.
data
.
data
.
ageNotes
,
phoneNumber
:
ctx
.
request
.
body
.
data
.
data
.
phoneNumber
,
minGroupSize
:
ctx
.
request
.
body
.
data
.
data
.
minGroupSize
,
maxGroupSize
:
ctx
.
request
.
body
.
data
.
data
.
maxGroupSize
,
activityType
:
ctx
.
request
.
body
.
data
.
data
.
activityType
,
link
:
ctx
.
request
.
body
.
data
.
data
.
link
,
cancellationPolicy
:
ctx
.
request
.
body
.
data
.
data
.
cancellationPolicy
,
// vendor: ctx.request.body.data.
data.
vendor.id,
subCategory
:
subCategory
.
id
,
category
:
category
.
id
,
giftSomeone
:
ctx
.
request
.
body
.
data
.
giftSomeone
,
fromDate
:
ctx
.
request
.
body
.
data
.
fromDate
,
toDate
:
ctx
.
request
.
body
.
data
.
toDate
,
fromTime
:
ctx
.
request
.
body
.
data
.
fromTime
,
toTime
:
ctx
.
request
.
body
.
data
.
toTime
,
offers
:
ctx
.
request
.
body
.
data
.
offers
,
rating
:
ctx
.
request
.
body
.
data
.
rating
,
giftSomeone
:
ctx
.
request
.
body
.
data
.
data
.
giftSomeone
,
fromDate
:
ctx
.
request
.
body
.
data
.
data
.
fromDate
,
toDate
:
ctx
.
request
.
body
.
data
.
data
.
toDate
,
fromTime
:
ctx
.
request
.
body
.
data
.
data
.
fromTime
,
toTime
:
ctx
.
request
.
body
.
data
.
data
.
toTime
,
offers
:
ctx
.
request
.
body
.
data
.
data
.
offers
,
rating
:
ctx
.
request
.
body
.
data
.
data
.
rating
,
contactPersonForActivity
:
ctx
.
request
.
body
.
data
.
contactPersonForActivity
,
ctx
.
request
.
body
.
data
.
data
.
contactPersonForActivity
,
contactPersonForBooking
:
ctx
.
request
.
body
.
data
.
contactPersonForBooking
,
...
ctx
.
request
.
body
.
data
.
daysBoolean
,
ctx
.
request
.
body
.
data
.
data
.
contactPersonForBooking
,
...
ctx
.
request
.
body
.
data
.
da
ta
.
da
ysBoolean
,
}
);
...
...
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