Gitlab@Informatics
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nail-spa-project-meloncd
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
65160014
nail-spa-project-meloncd
Commits
fb945947
Commit
fb945947
authored
2 weeks ago
by
65160014
Browse files
Options
Downloads
Patches
Plain Diff
Initial commit
parent
79dca686
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
controllers/bookingController.js
+4
-8
4 additions, 8 deletions
controllers/bookingController.js
with
4 additions
and
8 deletions
controllers/bookingController.js
+
4
−
8
View file @
fb945947
...
...
@@ -119,18 +119,14 @@ exports.bookingSummary = async (req, res) => {
if
(
!
appointmentId
)
{
return
res
.
status
(
400
).
send
(
"
ไม่พบรหัสการจอง
"
);
}
//
พยายาม
ดึงข้อมูลการจองจาก
ตารางหลัก
// ดึงข้อมูลการจองจาก
ทั้ง appointments และ appointment_history
let
appointment
=
await
bookingModel
.
getAppointmentById
(
appointmentId
);
// ถ้าไม่พบ ลองดึงจากตารางประวัติ (appointment_history)
if
(
!
appointment
)
{
appointment
=
await
bookingModel
.
getAppointmentFromHistoryById
(
appointmentId
);
if
(
!
appointment
)
{
throw
new
Error
(
"
ไม่พบการจอง
"
);
}
throw
new
Error
(
"
ไม่พบการจองในฐานข้อมูล
"
);
}
const
user
=
await
bookingModel
.
getUserById
(
appointment
.
user_id
);
const
service
=
await
bookingModel
.
getServiceById
(
appointment
.
service_id
);
const
slot
=
await
bookingModel
.
getBookingSlotById
(
appointment
.
booking_slot_id
);
...
...
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