Allow any admin to toggle SNL banner (#1955)

This commit is contained in:
ekzyis 2025-03-07 18:01:34 -06:00 committed by GitHub
parent 8ad352ee0f
commit 5b7ff24955
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,3 +1,5 @@
import { SN_ADMIN_IDS } from '@/lib/constants'
export default {
Query: {
snl: async (parent, _, { models }) => {
@ -7,7 +9,7 @@ export default {
},
Mutation: {
onAirToggle: async (parent, _, { models, me }) => {
if (me.id !== 616) {
if (!me || !SN_ADMIN_IDS.includes(me.id)) {
throw new Error('not an admin')
}
const { id, live } = await models.snl.findFirst()