mirror of
https://github.com/Infisical/infisical.git
synced 2025-03-25 14:05:03 +00:00
Feat: Remove orgSlug from create project endpoint
This commit is contained in:
@ -150,8 +150,7 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
||||
message: "Slug must be a valid slug"
|
||||
})
|
||||
.optional()
|
||||
.describe(PROJECTS.CREATE.slug),
|
||||
organizationSlug: z.string().trim().describe(PROJECTS.CREATE.organizationSlug)
|
||||
.describe(PROJECTS.CREATE.slug)
|
||||
}),
|
||||
response: {
|
||||
200: z.object({
|
||||
@ -166,7 +165,6 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
||||
actor: req.permission.type,
|
||||
actorOrgId: req.permission.orgId,
|
||||
actorAuthMethod: req.permission.authMethod,
|
||||
orgSlug: req.body.organizationSlug,
|
||||
workspaceName: req.body.projectName,
|
||||
slug: req.body.slug
|
||||
});
|
||||
|
@ -92,7 +92,6 @@ export const projectServiceFactory = ({
|
||||
* Create workspace. Make user the admin
|
||||
* */
|
||||
const createProject = async ({
|
||||
orgSlug,
|
||||
actor,
|
||||
actorId,
|
||||
actorOrgId,
|
||||
@ -100,13 +99,7 @@ export const projectServiceFactory = ({
|
||||
workspaceName,
|
||||
slug: projectSlug
|
||||
}: TCreateProjectDTO) => {
|
||||
if (!orgSlug) {
|
||||
throw new BadRequestError({
|
||||
message: "Must provide organization slug to create project"
|
||||
});
|
||||
}
|
||||
|
||||
const organization = await orgDAL.findOne({ slug: orgSlug });
|
||||
const organization = await orgDAL.findOne({ id: actorOrgId });
|
||||
|
||||
const { permission, membership: orgMembership } = await permissionService.getOrgPermission(
|
||||
actor,
|
||||
|
@ -24,7 +24,6 @@ export type TCreateProjectDTO = {
|
||||
actorAuthMethod: ActorAuthMethod;
|
||||
actorId: string;
|
||||
actorOrgId?: string;
|
||||
orgSlug: string;
|
||||
workspaceName: string;
|
||||
slug?: string;
|
||||
};
|
||||
|
Reference in New Issue
Block a user