mirror of
https://github.com/balzack/databag.git
synced 2025-02-13 03:59:16 +00:00
12 lines
514 B
JavaScript
12 lines
514 B
JavaScript
|
import { checkResponse, fetchWithTimeout } from './fetchUtil';
|
||
|
|
||
|
export async function setContactChannelTopicSubject(server, token, channelId, topicId, data) {
|
||
|
let subject = { data: JSON.stringify(data, (key, value) => {
|
||
|
if (value !== null) return value
|
||
|
}), datatype: 'superbasictopic' };
|
||
|
|
||
|
let channel = await fetchWithTimeout(`https://${server}//content/channels/${channelId}/topics/${topicId}/subject?contact=${token}`,
|
||
|
{ method: 'PUT', body: JSON.stringify(subject) });
|
||
|
checkResponse(channel);
|
||
|
}
|