Skip to content

Commit bbe11c0

Browse files
committed
changes bucketName to bucketId
1 parent 061fc1a commit bbe11c0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/lib/storage/StorageApi.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,19 +166,19 @@ export class StorageApi {
166166
/**
167167
* Renames an existing file.
168168
*
169-
* @param bucketName The bucket which contains the file.
169+
* @param bucketId The bucket which contains the file.
170170
* @param fromPath The original file path, including the current file name. For example `folder/image.png`.
171171
* @param toPath The new file path, including the new file name. For example `folder/image-copy.png`.
172172
*/
173173
async renameFile(
174-
bucketName: string,
174+
bucketId: string,
175175
fromPath: string,
176176
toPath: string
177177
): Promise<{ data: { message: string } | null; error: Error | null }> {
178178
try {
179179
const data = await post(
180180
`${this.url}/object/rename`,
181-
{ bucketName, sourceKey: fromPath, destinationKey: toPath },
181+
{ bucketId, sourceKey: fromPath, destinationKey: toPath },
182182
{ headers: this.headers }
183183
)
184184
return { data, error: null }
@@ -246,16 +246,16 @@ export class StorageApi {
246246
/**
247247
* Deletes multiple files within the same bucket
248248
*
249-
* @param bucketName The bucket which contains the files.
249+
* @param bucketId The bucket which contains the files.
250250
* @param paths An array of files to be deletes, including the path and file name. For example [`folder/image.png`].
251251
*/
252252
async deleteFiles(
253-
bucketName: string,
253+
bucketId: string,
254254
paths: string[]
255255
): Promise<{ data: FileObject[] | null; error: Error | null }> {
256256
try {
257257
const data = await remove(
258-
`${this.url}/object/${bucketName}`,
258+
`${this.url}/object/${bucketId}`,
259259
{ prefixes: paths },
260260
{ headers: this.headers }
261261
)
@@ -297,18 +297,18 @@ export class StorageApi {
297297

298298
/**
299299
* Lists all the files within a bucket.
300-
* @param bucketName The bucket which contains the files.
300+
* @param bucketId The bucket which contains the files.
301301
* @param path The folder path.
302302
* @param options Search options.
303303
*/
304304
async listFiles(
305-
bucketName: string,
305+
bucketId: string,
306306
path?: string,
307307
options?: SearchOptions
308308
): Promise<{ data: FileObject[] | null; error: Error | null }> {
309309
try {
310310
const body = { ...DEFAULT_SEARCH_OPTIONS, ...options, prefix: path || '' }
311-
const data = await post(`${this.url}/search/${bucketName}`, body, { headers: this.headers })
311+
const data = await post(`${this.url}/search/${bucketId}`, body, { headers: this.headers })
312312
return { data, error: null }
313313
} catch (error) {
314314
return { data: null, error }

0 commit comments

Comments
 (0)