I added authentication token for allow IOU or IOS templates to be created

This commit is contained in:
Rajnikant 2022-05-16 18:39:19 +05:30
parent f055836f44
commit 4f90a6d1fd
2 changed files with 6 additions and 4 deletions

View File

@ -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() {

View File

@ -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']);
}