mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
removed condition to create version from dev env only (#10247)
This commit is contained in:
parent
b617b09f5a
commit
b44f99b880
1 changed files with 1 additions and 14 deletions
|
|
@ -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 } });
|
||||
|
|
|
|||
Loading…
Reference in a new issue