diff --git a/pages/api/websites/[id]/index.ts b/pages/api/websites/[id]/index.ts index f26313c4..7b634e13 100644 --- a/pages/api/websites/[id]/index.ts +++ b/pages/api/websites/[id]/index.ts @@ -41,7 +41,7 @@ export default async ( if (req.method === 'POST') { const { ...data } = req.body; - if (!data.userId && !data.teamId) { + if (data.userId && data.userId === null && data.teamId && data.teamId === null) { badRequest(res, 'A website must be assigned to a User or Team.'); } diff --git a/tsconfig.json b/tsconfig.json index cbb5413f..b022d603 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,6 +23,6 @@ "noEmit": true, "jsx": "preserve" }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "queries/admin/website/getAllWebsites.ts"], + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], "exclude": ["node_modules"] }