@@ -264,7 +264,7 @@ router.post("/edit_registration", async (req, res) => {
264
264
if ( registration . type_id != 2 ) {
265
265
const authorized = await checkPermission ( req , res , [
266
266
{ club_rep : 4 , club_id : registration . club_id } ,
267
- // { executive: 4 },
267
+ { executive : 3 } ,
268
268
] ) ;
269
269
if ( ! authorized ) {
270
270
return ;
@@ -394,6 +394,18 @@ router.post("/edit_registration", async (req, res) => {
394
394
router . post ( "/delete_registration" , async ( req , res ) => {
395
395
const { id } = req . query ;
396
396
397
+ if ( ! registration . student_id === req . session . user . student_id ) {
398
+ if ( registration . type_id != 2 ) {
399
+ const authorized = await checkPermission ( req , res , [
400
+ { club_rep : 4 , club_id : registration . club_id } ,
401
+ { executive : 3 } ,
402
+ ] ) ;
403
+ if ( ! authorized ) {
404
+ return ;
405
+ }
406
+ }
407
+ }
408
+
397
409
const registration = await Registration . findByPk ( id ) ;
398
410
if ( ! registration ) {
399
411
return res
@@ -435,6 +447,11 @@ router.post("/delete_registration", async (req, res) => {
435
447
transaction,
436
448
} ) ;
437
449
450
+ await RegistrationFeedback . destroy ( {
451
+ where : { registration : id } ,
452
+ transaction,
453
+ } ) ;
454
+
438
455
// 관련 RegistrationSign 삭제
439
456
await RegistrationSign . destroy ( {
440
457
where : { registration : id } ,
@@ -540,7 +557,7 @@ router.get("/get_registration", async (req, res) => {
540
557
if ( registration . type_id != 2 ) {
541
558
const authorized = await checkPermission ( req , res , [
542
559
{ club_rep : 4 , club_id : registration . club_id } ,
543
- // { executive: 4 },
560
+ { executive : 4 } ,
544
561
] ) ;
545
562
if ( ! authorized ) {
546
563
return ;
0 commit comments