mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
fix viewer page loading method (#6577)
This commit is contained in:
@@ -80,7 +80,7 @@ async function getApplicationByStatus(status: string) {
|
||||
await alfrescoJsApiDevops.login(args.devopsUsername, args.devopsPassword);
|
||||
|
||||
return alfrescoJsApiDevops.oauth2Auth.callCustomApi(url, 'GET', pathParams, queryParams, headerParams, formParams, bodyParam,
|
||||
contentTypes, accepts).on('error',(error)=>{
|
||||
contentTypes, accepts).on('error', (error) => {
|
||||
logger.error(`Get application by status ${error} `);
|
||||
});
|
||||
|
||||
@@ -138,7 +138,7 @@ function getProjectRelease(projectId: string) {
|
||||
}
|
||||
}
|
||||
|
||||
function releaseProject(projectId: string) {
|
||||
async function releaseProject(projectId: string) {
|
||||
const url = `${args.host}/modeling-service/v1/projects/${projectId}/releases`;
|
||||
|
||||
const pathParams = {}, queryParams = {},
|
||||
@@ -149,11 +149,28 @@ function releaseProject(projectId: string) {
|
||||
contentTypes, accepts);
|
||||
|
||||
} catch (error) {
|
||||
await deleteProject(projectId);
|
||||
logger.error('Post Projects Release' + error.status);
|
||||
isValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
function deleteProject(projectId: string) {
|
||||
const url = `${args.host}/modeling-service/v1/projects/${projectId}`;
|
||||
|
||||
const pathParams = {}, queryParams = {},
|
||||
headerParams = {}, formParams = {}, bodyParam = {},
|
||||
contentTypes = ['application/json'], accepts = ['application/json'];
|
||||
try {
|
||||
return alfrescoJsApiModeler.oauth2Auth.callCustomApi(url, 'DELETE', pathParams, queryParams, headerParams, formParams, bodyParam,
|
||||
contentTypes, accepts);
|
||||
|
||||
} catch (error) {
|
||||
logger.error('Delete project error' + error.status);
|
||||
isValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function importAndReleaseProject(absoluteFilePath: string) {
|
||||
const fileContent = await fs.createReadStream(absoluteFilePath);
|
||||
|
||||
|
Reference in New Issue
Block a user