Skip to content

Commit 1d676f6

Browse files
committed
type defination improve. convert responseFields array to string
1 parent 9e09b15 commit 1d676f6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

libs/interfaces/UploadOptions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export interface UploadOptions {
3838
* - % is not allowed.
3939
* - If this field is not specified and the file is overwritten then the tags will be removed.
4040
*/
41-
tags?: string;
41+
tags?: string | string[];
4242
/**
4343
* The folder path (e.g. /images/folder/) in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created.
4444
* The folder name can contain:
@@ -68,7 +68,7 @@ export interface UploadOptions {
6868
*
6969
* For example, set the value of this field to tags,customCoordinates,isPrivateFile,metadata to get value of tags, customCoordinates, isPrivateFile , and metadata in the response.
7070
*/
71-
responseFields?: string;
71+
responseFields?: string | string[];
7272
/*
7373
* Object with array of extensions to be processed on the image.
7474
*/

libs/upload/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ export default function (
5555
form.append('file', uploadOptions.file, String(uploadOptions.fileName));
5656
} else if (key == "tags" && Array.isArray(uploadOptions.tags)) {
5757
form.append('tags', uploadOptions.tags.join(","));
58-
}
59-
else if (key == "extensions" && Array.isArray(uploadOptions.extensions)) {
58+
} else if (key == "responseFields" && Array.isArray(uploadOptions.responseFields)) {
59+
form.append('responseFields', uploadOptions.responseFields.join(","));
60+
} else if (key == "extensions" && Array.isArray(uploadOptions.extensions)) {
6061
form.append('extensions', JSON.stringify(uploadOptions.extensions));
6162
} else if (key === "customMetadata" && typeof uploadOptions.customMetadata === "object" &&
6263
!Array.isArray(uploadOptions.customMetadata) && uploadOptions.customMetadata !== null) {

0 commit comments

Comments
 (0)