Skip to content

Commit

Permalink
feat: update to slack file upload-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Wiebke Freitag committed Jan 23, 2024
1 parent 10843ba commit 7df6d1c
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 540 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"react-share": "^5.0.3",
"react-spring": "^9.7.3",
"react-use": "^17.4.4",
"rehype-react": "^8.0.0",
"rehype-react": "^7.2.0",
"sass": "^1.70.0",
"schema-dts": "^1.1.2",
"sharp": "^0.33.2",
Expand All @@ -93,7 +93,7 @@
"striptags": "^3.2.0",
"styled-components": "^6.1.8",
"stylis": "^4.3.1",
"unified": "^11.0.4",
"unified": "^10.1.1",
"util": "^0.12.5",
"webpack": "^5.84.1",
"what-input": "^5.2.12"
Expand Down
14 changes: 9 additions & 5 deletions src/api/career-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,16 @@ export default async function handler(
icon_emoji: ':rocket:',
});

for (const file of files) {
await client.files.upload({
channels: CHANNEL_ID,
if (postMessageResult.ts) {
await client.files.uploadV2({

Check failure on line 151 in src/api/career-form.ts

View workflow job for this annotation

GitHub Actions / Test

Argument of type '{ channel_id: string; thread_ts: string; file_uploads: any[]; }' is not assignable to parameter of type 'FilesUploadV2Arguments'.
channel_id: CHANNEL_ID,
thread_ts: postMessageResult.ts,
file: file.buffer,
filename: file.originalname,
file_uploads: [
...files.map((file) => ({
file: file.buffer,
filename: file.originalname,
})),
],
});
}
} catch (error) {
Expand Down
Loading

0 comments on commit 7df6d1c

Please sign in to comment.