generated from VLADIMIR/template_frontend
15 lines
495 B
TypeScript
15 lines
495 B
TypeScript
import type { Team } from '@/api/generated/crabs/evening_detective_server'
|
|
|
|
export function hasNewTeamApplications(previous: Team[], current: Team[]): boolean {
|
|
const previousKeys = new Set(
|
|
previous.flatMap((team) =>
|
|
(team.applications || []).map((application) => JSON.stringify([team.ID, application.name])),
|
|
),
|
|
)
|
|
return current.some((team) =>
|
|
team.applications?.some(
|
|
(application) => !previousKeys.has(JSON.stringify([team.ID, application.name])),
|
|
),
|
|
)
|
|
}
|