Skip to content

Commit

Permalink
0.0.2 - fix file uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
williamhorning committed Aug 23, 2024
1 parent 979db42 commit cde20c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/rvapi/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jersey/rvapi",
"version": "0.0.1",
"version": "0.0.2",
"exports": "./src/mod.ts",
"imports": {
"@denosaurs/event": "jsr:@denosaurs/event@^2.0.2",
Expand Down
5 changes: 2 additions & 3 deletions packages/rvapi/src/media/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,12 @@ export class MediaServices {
const resp = await fetch(`${this.autumn.url}/${tag}`, {
method: 'POST',
body: form,
headers: { 'Content-Type': 'multipart/form-data' },
});

const data = await resp.json();

if (!resp.ok || resp.type) {
throw new MediaError('upload file', data.type);
if (!resp.ok || data.type) {
throw new Error('upload file', { cause: resp });
}

return data.id;
Expand Down

0 comments on commit cde20c3

Please sign in to comment.