mirror of
https://github.com/hex248/sprint.git
synced 2026-02-08 02:33:01 +00:00
multiple projects can be created with the same blob/key (just not in the same org)
This commit is contained in:
@@ -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);
|
const existingProject = await getProjectByBlob(blob);
|
||||||
if (existingProject) {
|
if (existingProject?.organisationId === parseInt(organisationId, 10)) {
|
||||||
return new Response(`project with blob ${blob} already exists`, { status: 400 });
|
return new Response(`project with blob ${blob} already exists`, { status: 400 });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user