Skip to content

Commit

Permalink
Allow any admin to toggle SNL banner
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzyis committed Mar 7, 2025
1 parent e269a8e commit c637b6d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/resolvers/admin.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { SN_ADMIN_IDS } from '@/lib/constants'

export default {
Query: {
snl: async (parent, _, { models }) => {
Expand All @@ -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()
Expand Down

0 comments on commit c637b6d

Please sign in to comment.