Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
butter-studio
Commits
bc24bfb5
Commit
bc24bfb5
authored
Jul 27, 2021
by
Kim, Subin
Browse files
getAll & remove 완성
parent
c6dc0753
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/controllers/ticketfee.controller.js
View file @
bc24bfb5
...
@@ -2,8 +2,8 @@ import { TicketFee } from "../db/index.js";
...
@@ -2,8 +2,8 @@ import { TicketFee } from "../db/index.js";
const
getAll
=
async
(
req
,
res
)
=>
{
const
getAll
=
async
(
req
,
res
)
=>
{
try
{
try
{
const
findAll
=
await
TicketFee
.
findAll
()
const
findAll
=
await
TicketFee
.
findAll
(
{
attributes
:
{
exclude
:
[
'
createdAt
'
,
'
updatedAt
'
]
}
}
)
console
.
log
(
"
find==
"
,
findAll
)
return
res
.
json
(
findAll
)
}
catch
(
error
)
{
}
catch
(
error
)
{
return
res
.
status
(
500
).
send
(
error
.
message
||
"
관람료 정보 가져오는 중 에러 발생
"
)
return
res
.
status
(
500
).
send
(
error
.
message
||
"
관람료 정보 가져오는 중 에러 발생
"
)
}
}
...
@@ -41,8 +41,9 @@ const edit = async (req, res) => {
...
@@ -41,8 +41,9 @@ const edit = async (req, res) => {
const
remove
=
async
(
req
,
res
)
=>
{
const
remove
=
async
(
req
,
res
)
=>
{
try
{
try
{
const
{
theaterType
}
=
req
.
query
const
{
theaterType
}
=
req
.
query
const
delTicketFee
=
await
TicketFee
.
destroy
({
where
:
{
theaterType
:
theaterType
}
})
const
delNum
=
await
TicketFee
.
destroy
({
where
:
{
theaterType
:
theaterType
}
})
console
.
log
(
"
del==
"
,
delTicketFee
)
if
(
delNum
)
res
.
json
(
delNum
)
else
throw
new
Error
(
"
해당 정보를 서버에서 삭제하는데 실패했습니다.
"
);
}
catch
(
error
)
{
}
catch
(
error
)
{
return
res
.
status
(
500
).
send
(
error
.
message
||
"
관람료 정보 삭제 중 에러 발생
"
)
return
res
.
status
(
500
).
send
(
error
.
message
||
"
관람료 정보 삭제 중 에러 발생
"
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment