1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-05 13:55:21 +02:00

fix(customtemplate): create from file (#4769)

* fix(customtemplate): receive File from api

* fix(customtemplate): return custom template

fix #4384
This commit is contained in:
Chaim Lev-Ari 2021-02-17 17:56:44 +02:00 committed by GitHub
parent 739dda1318
commit 45afe76bc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View file

@ -41,7 +41,8 @@ function CustomTemplateServiceFactory(CustomTemplates, FileUploadService) {
service.createCustomTemplateFromFileUpload = async function createCustomTemplateFromFileUpload(payload) {
try {
return await FileUploadService.createCustomTemplate(payload);
const { data } = await FileUploadService.createCustomTemplate(payload);
return data;
} catch (err) {
throw { msg: 'Unable to create the customTemplate', err };
}

View file

@ -65,12 +65,12 @@ class CreateCustomTemplateViewController {
this.state.actionInProgress = true;
try {
const { ResourceControl } = await this.createCustomTemplateByMethod(method);
const customTemplate = await this.createCustomTemplateByMethod(method);
const accessControlData = this.formValues.AccessControlData;
const userDetails = this.Authentication.getUserDetails();
const userId = userDetails.ID;
await this.ResourceControlService.applyResourceControl(userId, accessControlData, ResourceControl);
await this.ResourceControlService.applyResourceControl(userId, accessControlData, customTemplate.ResourceControl);
this.Notifications.success('Custom template successfully created');
this.$state.go('docker.templates.custom');