mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 11:39:17 +00:00
11 lines
451 B
JavaScript
11 lines
451 B
JavaScript
|
import { checkResponse, fetchWithTimeout } from './fetchUtil';
|
||
|
|
||
|
export async function addChannel(token, cards, subject, description ) {
|
||
|
let data = { subject, description };
|
||
|
let params = { dataType: 'superbasic', data: JSON.stringify(data), groups: [], cards };
|
||
|
let channel = await fetchWithTimeout(`/content/channels?agent=${token}`, { method: 'POST', body: JSON.stringify(params)} );
|
||
|
checkResponse(channel);
|
||
|
return await channel.json();
|
||
|
}
|
||
|
|