Commit 4d64cec
committed
feat(hackathons): Add delete functionality with confirmation dialog and enhanced logging
- Add delete button to hackathon management table with trash icon
- Implement confirmation dialog for hackathon deletion using AlertDialog component
- Add comprehensive logging throughout DELETE endpoint for debugging
- Enhance error handling with auth error checking and proper HTTP status codes (403 for unauthorized)
- Update DELETE response format to include success flag
- Add error message details in 500 response for better debugging
- Include tooltips on action buttons (Edit, View, Delete) for better UX
- Add delete state management (deleteDialogOpen, hackathonToDelete, isDeleting)
- Implement handleDeleteClick and handleDeleteConfirm functions for deletion workflow
- Use hackathon slug instead of id for API endpoint consistency
- Add success and error toast notifications for user feedback
- Refresh hackathon list after successful deletion1 parent af7b5f9 commit 4d64cec
File tree
3 files changed
+117
-12
lines changed- app
- api/hackathons/[id]
- dashboard/company/[slug]/hackathons
- lib/services
3 files changed
+117
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
116 | 118 | | |
117 | 119 | | |
118 | | - | |
| 120 | + | |
119 | 121 | | |
120 | | - | |
| 122 | + | |
| 123 | + | |
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
124 | 127 | | |
125 | 128 | | |
126 | 129 | | |
| 130 | + | |
| 131 | + | |
127 | 132 | | |
128 | 133 | | |
129 | 134 | | |
130 | 135 | | |
| 136 | + | |
131 | 137 | | |
132 | 138 | | |
133 | 139 | | |
134 | 140 | | |
135 | 141 | | |
136 | 142 | | |
| 143 | + | |
| 144 | + | |
137 | 145 | | |
138 | 146 | | |
139 | 147 | | |
| |||
145 | 153 | | |
146 | 154 | | |
147 | 155 | | |
| 156 | + | |
148 | 157 | | |
149 | 158 | | |
150 | 159 | | |
| |||
159 | 168 | | |
160 | 169 | | |
161 | 170 | | |
| 171 | + | |
162 | 172 | | |
163 | 173 | | |
164 | 174 | | |
165 | 175 | | |
| 176 | + | |
166 | 177 | | |
167 | 178 | | |
168 | | - | |
| 179 | + | |
169 | 180 | | |
170 | 181 | | |
171 | 182 | | |
| 183 | + | |
172 | 184 | | |
| 185 | + | |
173 | 186 | | |
174 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
175 | 191 | | |
176 | | - | |
| 192 | + | |
177 | 193 | | |
178 | | - | |
| 194 | + | |
179 | 195 | | |
180 | 196 | | |
181 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
14 | 24 | | |
15 | 25 | | |
16 | 26 | | |
| |||
34 | 44 | | |
35 | 45 | | |
36 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
37 | 50 | | |
38 | 51 | | |
39 | 52 | | |
| |||
65 | 78 | | |
66 | 79 | | |
67 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
68 | 115 | | |
69 | 116 | | |
70 | 117 | | |
| |||
287 | 334 | | |
288 | 335 | | |
289 | 336 | | |
290 | | - | |
| 337 | + | |
291 | 338 | | |
292 | 339 | | |
293 | 340 | | |
294 | 341 | | |
295 | 342 | | |
296 | | - | |
| 343 | + | |
297 | 344 | | |
298 | 345 | | |
299 | 346 | | |
300 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
301 | 357 | | |
302 | 358 | | |
303 | 359 | | |
| |||
318 | 374 | | |
319 | 375 | | |
320 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
321 | 400 | | |
322 | 401 | | |
323 | 402 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
314 | 316 | | |
315 | 317 | | |
316 | 318 | | |
| 319 | + | |
317 | 320 | | |
318 | 321 | | |
319 | | - | |
320 | | - | |
| 322 | + | |
| 323 | + | |
321 | 324 | | |
322 | 325 | | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
323 | 333 | | |
324 | 334 | | |
325 | 335 | | |
| |||
0 commit comments