multiple projects can be created with the same blob/key (just not in the same org)

This commit is contained in:
Oliver Bryan
2025-12-29 05:31:33 +00:00
parent 39fa230d31
commit 658b5eb669

View File

@@ -16,9 +16,9 @@ export default async function projectCreate(req: BunRequest) {
);
}
// check if project with blob already exists
// check if project with blob already exists in the organisation
const existingProject = await getProjectByBlob(blob);
if (existingProject) {
if (existingProject?.organisationId === parseInt(organisationId, 10)) {
return new Response(`project with blob ${blob} already exists`, { status: 400 });
}