Gitlab@Informatics
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IFREPAIRS_FINAL
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
65160111
IFREPAIRS_FINAL
Commits
fed9ea90
Commit
fed9ea90
authored
2 weeks ago
by
65160111
Browse files
Options
Downloads
Patches
Plain Diff
edit route update report
parent
c18867e4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
routes/reports.js
+3
-3
3 additions, 3 deletions
routes/reports.js
with
3 additions
and
3 deletions
routes/reports.js
+
3
−
3
View file @
fed9ea90
...
...
@@ -120,10 +120,10 @@ router.get("/:id", authMiddleware, (req, res) => {
// 🔹 Update Report (แก้ไขเฉพาะ Title, Description)
router
.
put
(
"
/:id
"
,
authMiddleware
,
(
req
,
res
)
=>
{
const
{
title
,
description
}
=
req
.
body
;
const
{
title
,
description
,
room_id
}
=
req
.
body
;
db
.
query
(
"
UPDATE reports SET title=?, description=? WHERE id=?
"
,
[
title
,
description
,
req
.
params
.
id
],
"
UPDATE reports SET title=?, description=?
, room_id=?
WHERE id=?
"
,
[
title
,
description
,
room_id
,
req
.
params
.
id
],
(
err
,
result
)
=>
{
if
(
err
)
return
res
.
status
(
500
).
json
({
error
:
err
.
message
});
res
.
json
({
message
:
"
Report Updated!
"
});
...
...
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