Merge pull request #3505 from eoussama/master

Added optional website ID for creation
This commit is contained in:
Mike Cao 2025-07-07 22:58:16 -07:00 committed by GitHub
commit b2a6e3f842
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 43 additions and 6 deletions

View file

@ -26,6 +26,7 @@ export async function POST(request: Request) {
domain: z.string().max(500),
shareId: z.string().max(50).nullable().optional(),
teamId: z.string().nullable().optional(),
id: z.string().uuid().nullable().optional(),
});
const { auth, body, error } = await parseRequest(request, schema);
@ -34,14 +35,14 @@ export async function POST(request: Request) {
return error();
}
const { name, domain, shareId, teamId } = body;
const { id, name, domain, shareId, teamId } = body;
if ((teamId && !(await canCreateTeamWebsite(auth, teamId))) || !(await canCreateWebsite(auth))) {
return unauthorized();
}
const data: any = {
id: uuid(),
id: id ?? uuid(),
createdBy: auth.user.id,
name,
domain,