Add missing type declaration for isEditor
Some checks reported errors
continuous-integration/drone/promote/production Build is failing
continuous-integration/drone/push Build was killed

This commit is contained in:
tobias 2024-06-23 11:21:50 +02:00
parent e63dd42b6c
commit d77c33f548

View File

@ -2,7 +2,7 @@ import { Access, FieldAccess } from 'payload/types'
import type { User } from 'types/payload-types' import type { User } from 'types/payload-types'
export const isEditor = ({ req: { user } }: any) => { export const isEditor = ({ req: { user } }: any) => {
if (user?.roles?.some((role) => ['editor', 'admin'].includes(role))) { if (user && user?.roles?.some((role: string) => ['editor', 'admin'].includes(role))) {
return true return true
} }