@@ -2,7 +2,7 @@ import type * as Models from './models';
22import type * as Parameters from './parameters' ;
33import type { Client } from '../clients' ;
44import type { Callback } from '../callback' ;
5- import type { Request } from '../requestConfig ' ;
5+ import type { Request } from '../request ' ;
66import { FormDataService } from '../services/formDataService' ;
77
88export class IssueAttachments {
@@ -380,10 +380,7 @@ export class IssueAttachments {
380380 * to view the issue.
381381 */
382382 async addAttachment < T = Models . Attachment [ ] > ( parameters : Parameters . AddAttachment , callback ?: never ) : Promise < T > ;
383- async addAttachment < T = Models . Attachment [ ] > (
384- parameters : Parameters . AddAttachment ,
385- callback ?: Callback < T > ,
386- ) : Promise < void | T > {
383+ async addAttachment < T = Models . Attachment [ ] > ( parameters : Parameters . AddAttachment ) : Promise < void | T > {
387384 const formDataService = new FormDataService ( ) ;
388385 const attachments = Array . isArray ( parameters . attachment ) ? parameters . attachment : [ parameters . attachment ] ;
389386
@@ -396,18 +393,18 @@ export class IssueAttachments {
396393 ) ,
397394 ) ;
398395
399- const config : RequestConfig = {
396+ const config : Request = {
400397 url : `/rest/api/2/issue/${ parameters . issueIdOrKey } /attachments` ,
401398 method : 'POST' ,
402399 headers : {
403400 'X-Atlassian-Token' : 'no-check' ,
404401 'Content-Type' : 'multipart/form-data' ,
405402 } ,
406- data : formDataService . formData ,
407- maxBodyLength : Infinity ,
408- maxContentLength : Infinity ,
403+ body : formDataService . formData ,
404+ // maxBodyLength: Infinity, // todo needed?
405+ // maxContentLength: Infinity, // todo needed?
409406 } ;
410407
411- return this . client . sendRequest ( config , callback ) ;
408+ return this . client . sendRequest ( config ) ;
412409 }
413410}
0 commit comments