Refactor feature flag utilities to inject Payload instance, add strict types, and update .npmignore settings

This commit is contained in:
2025-09-12 15:57:41 +02:00
parent 48834c6fa2
commit 2fdef92d62
5 changed files with 85 additions and 28 deletions

View File

@@ -3,7 +3,7 @@ import type { PayloadHandler } from 'payload'
export const customEndpointHandler = (collectionSlug: string): PayloadHandler =>
async (req) => {
const { payload } = req
const url = new URL(req.url)
const url = new URL(req.url || '')
const pathParts = url.pathname.split('/').filter(Boolean)
const flagName = pathParts[pathParts.length - 1]