Skip to content

Commit

Permalink
Fix a bug where token param is ignored inside files.upload v2 method
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Apr 11, 2024
1 parent ec7c877 commit 6f145e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/client/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ export class SlackAPIClient {
)
: new TextEncoder().encode(f.content);
const getUrl = await client.files.getUploadURLExternal({
token: params.token,
filename: f.filename,
length: body.length,
snippet_type: f.snippet_type,
Expand Down Expand Up @@ -642,6 +643,7 @@ export class SlackAPIClient {
completes.push(uploadAsync());
}
const completion = await this.files.completeUploadExternal({
token: params.token,
files: await Promise.all(completes),
channel_id: params.channel_id,
initial_comment: params.initial_comment,
Expand Down
2 changes: 2 additions & 0 deletions src_deno/client/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ export class SlackAPIClient {
)
: new TextEncoder().encode(f.content);
const getUrl = await client.files.getUploadURLExternal({
token: params.token,
filename: f.filename,
length: body.length,
snippet_type: f.snippet_type,
Expand Down Expand Up @@ -643,6 +644,7 @@ export class SlackAPIClient {
completes.push(uploadAsync());
}
const completion = await this.files.completeUploadExternal({
token: params.token,
files: await Promise.all(completes),
channel_id: params.channel_id,
initial_comment: params.initial_comment,
Expand Down

0 comments on commit 6f145e0

Please sign in to comment.