removed condition to create version from dev env only (#10247)

This commit is contained in:
Rudhra Deep Biswas 2024-07-15 21:00:56 +05:30 committed by GitHub
parent b617b09f5a
commit b44f99b880
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -345,25 +345,12 @@ export class AppsService {
return await dbTransactionWrap(async (manager: EntityManager) => {
let versionFrom: AppVersion;
const { organizationId } = user;
if (versionFromId) {
versionFrom = await manager.findOneOrFail(AppVersion, {
where: { id: versionFromId },
relations: ['dataSources', 'dataSources.dataQueries', 'dataSources.dataSourceOptions'],
});
if (defaultAppEnvironments.length > 1) {
const environmentWhereUserCreatingVersion = await this.appEnvironmentService.get(
app.organizationId,
environmentId,
false,
manager
);
//check if the user is creating version from development environment only
if (environmentWhereUserCreatingVersion.priority !== 1) {
throw new BadRequestException('New versions can only be created in development environment');
}
}
}
const noOfVersions = await manager.count(AppVersion, { where: { appId: app?.id } });