Skip to content

Commit

Permalink
Parse upload response
Browse files Browse the repository at this point in the history
  • Loading branch information
wwerner committed Sep 5, 2024
1 parent 17e00db commit 3ad4089
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export async function run(): Promise<void> {
...discourseHeaders
},
body: stream(payload)
}).then(async res => res.text())
})
.then(res => res.json())

Check failure on line 41 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Functions that return promises must be async
.then(async body => body.short_path)
}

const updatePost = async (specPath: string): Promise<void> => {
Expand Down Expand Up @@ -65,7 +67,7 @@ export async function run(): Promise<void> {
core.debug(new Date().toTimeString())
await upload(specFile)
.then(async specPath =>
// we can coerce string | vpid into string as void happens only with client side aborted requests
// we can coerce string | void into string as void happens only with client side aborted requests
updatePost(specPath as string)
)
.then(console.log)
Expand Down

0 comments on commit 3ad4089

Please sign in to comment.