Gitlab@Informatics
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
65160394
Project
Commits
bda8d324
Commit
bda8d324
authored
3 months ago
by
65160394
Browse files
Options
Downloads
Patches
Plain Diff
Project Round 11
parent
0ec926f4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
controllers/tourController.js
+3
-3
3 additions, 3 deletions
controllers/tourController.js
with
3 additions
and
3 deletions
controllers/tourController.js
+
3
−
3
View file @
bda8d324
...
...
@@ -225,7 +225,7 @@ exports.getEditTour = async (req, res) => {
exports
.
postEditTour
=
async
(
req
,
res
)
=>
{
const
{
name
,
description
,
price
,
duration
}
=
req
.
body
;
const
{
name
,
description
,
price
,
duration
,
companyid
}
=
req
.
body
;
const
tourId
=
req
.
params
.
id
;
// ดึง id จาก URL parameters
console
.
log
(
'
📥 Data received:
'
,
req
.
body
);
// ตรวจสอบข้อมูลที่ได้รับจากฟอร์ม
...
...
@@ -234,11 +234,11 @@ exports.postEditTour = async (req, res) => {
return
res
.
status
(
400
).
send
(
'
ไม่พบข้อมูลทัวร์
'
);
}
if
(
!
name
||
!
description
||
!
price
||
!
duration
)
{
if
(
!
name
||
!
description
||
!
price
||
!
duration
||
!
companyid
)
{
return
res
.
status
(
400
).
send
(
'
กรุณากรอกข้อมูลให้ครบทุกช่อง
'
);
}
const
tourData
=
{
name
,
description
,
price
,
duration
};
const
tourData
=
{
name
,
description
,
price
,
duration
,
companyid
};
try
{
const
result
=
await
Tour
.
updateTour
(
tourId
,
tourData
);
// ส่ง tourId และ tourData
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment