From 4f90a6d1fdcf3d39b8bc3abe96ea2432acdf32de Mon Sep 17 00:00:00 2001 From: Rajnikant Date: Mon, 16 May 2022 18:39:19 +0530 Subject: [PATCH] I added authentication token for allow IOU or IOS templates to be created --- .../dynamips/add-ios-template/add-ios-template.component.ts | 4 ++-- .../add-iou-template/add-iou-template.component.ts | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/components/preferences/dynamips/add-ios-template/add-ios-template.component.ts b/src/app/components/preferences/dynamips/add-ios-template/add-ios-template.component.ts index 6b3118e2..ccf03b0e 100644 --- a/src/app/components/preferences/dynamips/add-ios-template/add-ios-template.component.ts +++ b/src/app/components/preferences/dynamips/add-ios-template/add-ios-template.component.ts @@ -135,9 +135,9 @@ export class AddIosTemplateComponent implements OnInit { this.uploader.queue.forEach((elem) => (elem.url = url)); const itemToUpload = this.uploader.queue[0]; - (itemToUpload as any).options.disableMultipart = true; - + if ((itemToUpload as any).options) (itemToUpload as any).options.disableMultipart = true; ((itemToUpload as any).options.headers = [{ name: 'Authorization', value: 'Bearer ' + this.server.authToken }]) this.uploader.uploadItem(itemToUpload); + } addTemplate() { diff --git a/src/app/components/preferences/ios-on-unix/add-iou-template/add-iou-template.component.ts b/src/app/components/preferences/ios-on-unix/add-iou-template/add-iou-template.component.ts index 61b55071..01c3bfac 100644 --- a/src/app/components/preferences/ios-on-unix/add-iou-template/add-iou-template.component.ts +++ b/src/app/components/preferences/ios-on-unix/add-iou-template/add-iou-template.component.ts @@ -106,11 +106,13 @@ export class AddIouTemplateComponent implements OnInit { this.uploader.queue.forEach((elem) => (elem.url = url)); const itemToUpload = this.uploader.queue[0]; - (itemToUpload as any).options.disableMultipart = true; - + if ((itemToUpload as any).options) (itemToUpload as any).options.disableMultipart = true; ((itemToUpload as any).options.headers = [{ name: 'Authorization', value: 'Bearer ' + this.server.authToken }]) this.uploader.uploadItem(itemToUpload); + } + + goBack() { this.router.navigate(['/server', this.server.id, 'preferences', 'iou', 'templates']); }