minio / minio-js

MinIO Client SDK for Javascript
https://docs.min.io/docs/javascript-client-quickstart-guide.html
Apache License 2.0
961 stars 281 forks source link

uploadpart method missing parameter #1333

Open MilkChan01 opened 3 months ago

MilkChan01 commented 3 months ago

` async uploadPart(partConfig: { bucketName: string objectName: string uploadID: string partNumber: number headers: RequestHeaders }) { const { bucketName, objectName, uploadID, partNumber, headers } = partConfig

const method = 'PUT'
const query = `uploadId=${uploadID}&partNumber=${partNumber}`
const requestOptions = { method, bucketName, objectName: objectName, query, headers }

const res = await this.makeRequestAsync(requestOptions)
const body = await readAsString(res)
const partRes = uploadPartParser(body)

return {
  etag: sanitizeETag(partRes.ETag),
  key: objectName,
  part: partNumber,
}

}

`

This method should receive payload parameters ,It should be changed to the following:

async uploadPart(partConfig: { bucketName: string objectName: string uploadID: string partNumber: number headers: RequestHeaders }),paylod: Binary){ //....... const res = await this.makeRequestAsync(requestOptions,paylod) //..... }

prakashsvmx commented 3 months ago

Feel free to contribute by sending a PR/Changes with functional tests @MilkChan01 .

prakashsvmx commented 3 months ago

Also please take a look at https://github.com/minio/minio-js/pull/1325

MilkChan01 commented 3 months ago

pr : https://github.com/minio/minio-js/pull/1334