Skip to content

Commit

Permalink
fix(fe): fix delete problem error (#2247)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kohminchae authored Nov 28, 2024
1 parent f9aa73f commit b876f14
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ export default function ProblemsDeleteButton() {
)

const results = await Promise.all(promises)
const isAllSafe = results.every(({ data }) => data === undefined)
const isAllSafe = results.every(({ data }) => {
const contests = data?.getContestsByProblemId
return (
contests?.finished.length === 0 &&
contests.ongoing.length === 0 &&
contests.upcoming.length === 0
)
})

if (isAllSafe) {
return true
Expand Down

0 comments on commit b876f14

Please sign in to comment.