mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-13 13:48:59 +02:00
fix: revert other changes
This commit is contained in:
parent
4a8f747f6f
commit
db8ef3f38f
@ -310,15 +310,6 @@ export default class ProjectService {
|
||||
return id;
|
||||
}
|
||||
|
||||
async generateUniqueProjectId(name: string): Promise<string> {
|
||||
const id = this.generateProjectId(name);
|
||||
if (await this.projectStore.hasProject(id)) {
|
||||
return await this.generateUniqueProjectId(name);
|
||||
} else {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
async createProject(
|
||||
newProject: CreateProject,
|
||||
user: IUser,
|
||||
@ -334,22 +325,9 @@ export default class ProjectService {
|
||||
const validateData = async (): Promise<ProjectCreationData> => {
|
||||
await this.validateProjectEnvironments(newProject.environments);
|
||||
|
||||
if (
|
||||
!newProject.id?.trim() &&
|
||||
this.flagResolver.isEnabled(
|
||||
'createProjectWithEnvironmentConfig',
|
||||
)
|
||||
) {
|
||||
newProject.id = await this.generateUniqueProjectId(
|
||||
newProject.name,
|
||||
);
|
||||
return await projectSchema.validateAsync(newProject);
|
||||
} else {
|
||||
const validatedData =
|
||||
await projectSchema.validateAsync(newProject);
|
||||
await this.validateUniqueId(validatedData.id);
|
||||
return validatedData;
|
||||
}
|
||||
const validatedData = await projectSchema.validateAsync(newProject);
|
||||
await this.validateUniqueId(validatedData.id);
|
||||
return validatedData;
|
||||
};
|
||||
|
||||
const validatedData = await validateData();
|
||||
|
@ -487,8 +487,7 @@ export interface IImportData extends ImportCommon {
|
||||
// Create project aligns with #/components/schemas/createProjectSchema
|
||||
// joi is providing default values when the optional inputs are not provided
|
||||
// const data = await projectSchema.validateAsync(newProject);
|
||||
export type CreateProject = Pick<IProject, 'name'> & {
|
||||
id?: string;
|
||||
export type CreateProject = Pick<IProject, 'id' | 'name'> & {
|
||||
mode?: ProjectMode;
|
||||
defaultStickiness?: string;
|
||||
environments?: string[];
|
||||
|
Loading…
Reference in New Issue
Block a user