Allow any admin to toggle SNL banner (#1955)
This commit is contained in:
parent
8ad352ee0f
commit
5b7ff24955
@ -1,3 +1,5 @@
|
|||||||
|
import { SN_ADMIN_IDS } from '@/lib/constants'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
Query: {
|
Query: {
|
||||||
snl: async (parent, _, { models }) => {
|
snl: async (parent, _, { models }) => {
|
||||||
@ -7,7 +9,7 @@ export default {
|
|||||||
},
|
},
|
||||||
Mutation: {
|
Mutation: {
|
||||||
onAirToggle: async (parent, _, { models, me }) => {
|
onAirToggle: async (parent, _, { models, me }) => {
|
||||||
if (me.id !== 616) {
|
if (!me || !SN_ADMIN_IDS.includes(me.id)) {
|
||||||
throw new Error('not an admin')
|
throw new Error('not an admin')
|
||||||
}
|
}
|
||||||
const { id, live } = await models.snl.findFirst()
|
const { id, live } = await models.snl.findFirst()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user