mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 12:39:17 +00:00
fix for failed cross posted asset
This commit is contained in:
parent
5edbf45577
commit
2ec1ed4c90
@ -6,7 +6,8 @@ export async function addContactChannelTopic(server, token, channelId, message,
|
|||||||
let topic = await fetchWithTimeout(`https://${server}/content/channels/${channelId}/topics?contact=${token}`,
|
let topic = await fetchWithTimeout(`https://${server}/content/channels/${channelId}/topics?contact=${token}`,
|
||||||
{ method: 'POST', body: JSON.stringify({}) });
|
{ method: 'POST', body: JSON.stringify({}) });
|
||||||
checkResponse(topic);
|
checkResponse(topic);
|
||||||
return await topic.json().id;
|
let slot = await topic.json();
|
||||||
|
return slot.id;
|
||||||
}
|
}
|
||||||
else if (assets == null || assets.length == 0) {
|
else if (assets == null || assets.length == 0) {
|
||||||
let subject = { data: JSON.stringify(message, (key, value) => {
|
let subject = { data: JSON.stringify(message, (key, value) => {
|
||||||
@ -16,7 +17,8 @@ export async function addContactChannelTopic(server, token, channelId, message,
|
|||||||
let topic = await fetchWithTimeout(`https://${server}/content/channels/${channelId}/topics?contact=${token}&confirm=true`,
|
let topic = await fetchWithTimeout(`https://${server}/content/channels/${channelId}/topics?contact=${token}&confirm=true`,
|
||||||
{ method: 'POST', body: JSON.stringify(subject) });
|
{ method: 'POST', body: JSON.stringify(subject) });
|
||||||
checkResponse(topic);
|
checkResponse(topic);
|
||||||
return await topic.json().id;
|
let slot = await topic.json();
|
||||||
|
return slot.id;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let topic = await fetchWithTimeout(`https://${server}/content/channels/${channelId}/topics?contact=${token}`,
|
let topic = await fetchWithTimeout(`https://${server}/content/channels/${channelId}/topics?contact=${token}`,
|
||||||
|
Loading…
Reference in New Issue
Block a user