Skip to content

Commit 6ad8c45

Browse files
added wrapper for upload media api call
1 parent f1e3e31 commit 6ad8c45

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

components/blotato/actions/upload-media/upload-media.mjs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,9 @@ export default {
2727
async run({ $ }) {
2828
const { url } = this;
2929

30-
const response = await this.blotato._makeRequest({
30+
const response = await this.blotato.uploadMedia({
3131
$,
32-
method: "POST",
33-
path: "/v2/media",
34-
data: {
35-
url,
36-
},
32+
url,
3733
});
3834

3935
$.export("$summary", `Successfully uploaded media. New URL: ${response.url}`);

components/blotato/blotato.app.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,16 @@ export default {
7070
});
7171
},
7272
uploadMedia({
73-
file, mediaType, ...args
73+
$, url, ...args
7474
} = {}) {
7575
return this._makeRequest({
76+
$,
7677
method: "POST",
7778
path: "/v2/media",
7879
data: {
79-
file,
80-
mediaType,
81-
...args,
80+
url,
8281
},
82+
...args,
8383
});
8484
},
8585
listTemplates({

0 commit comments

Comments
 (0)