burnstony#1975B
Convex Community2y ago
7 replies
burnstony#1975

access fetch body

how to get body from fetch and send to mutation

export const downloadRssBody = action({
args: {
id: v.id("podcast"), rss: v.string(),
},


// Action implementation.
handler: async (ctx, args) => {
const response = await fetch(args.rss);
const body = response.text();
console.log("downloadRssBody {body}");
ctx.runMutation(api.addPodcast.patchPodcastRss, {
id: args.id,
rss_body: response.text()
});

},
});
Was this page helpful?