databag/net/web/src/api/getChannel.js
2022-04-25 22:25:03 -07:00

9 lines
290 B
JavaScript

import { checkResponse, fetchWithTimeout } from './fetchUtil';
export async function getChannel(token, channelId) {
let channel = await fetchWithTimeout(`/content/channels/${channelId}/detail?agent=${token}`, { method: 'GET' });
checkResponse(channel)
return await channel.json()
}