|
@ -102,8 +102,9 @@ export async function declare({ uuid, name, description, tags, img, group_key, h |
|
|
export async function declare_bot({ uuid, name, description, tags, img, price_per_use, owner_pubkey, unlisted, deleted }) { |
|
|
export async function declare_bot({ uuid, name, description, tags, img, price_per_use, owner_pubkey, unlisted, deleted }) { |
|
|
console.log('=> declare_bot',{ uuid, name, description, tags, img, price_per_use, owner_pubkey, unlisted, deleted }) |
|
|
console.log('=> declare_bot',{ uuid, name, description, tags, img, price_per_use, owner_pubkey, unlisted, deleted }) |
|
|
const host = getHost() |
|
|
const host = getHost() |
|
|
|
|
|
console.log('=> https://' + host + '/bots') |
|
|
try { |
|
|
try { |
|
|
await fetch('https://' + host + '/bots', { |
|
|
const r = await fetch('https://' + host + '/bots', { |
|
|
method: 'POST', |
|
|
method: 'POST', |
|
|
body: JSON.stringify({ |
|
|
body: JSON.stringify({ |
|
|
uuid, owner_pubkey, |
|
|
uuid, owner_pubkey, |
|
@ -114,7 +115,8 @@ export async function declare_bot({ uuid, name, description, tags, img, price_pe |
|
|
}), |
|
|
}), |
|
|
headers: { 'Content-Type': 'application/json' } |
|
|
headers: { 'Content-Type': 'application/json' } |
|
|
}) |
|
|
}) |
|
|
// const j = await r.json()
|
|
|
const j = await r.json() |
|
|
|
|
|
console.log('=> j',j) |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
console.log('[tribes] unauthorized to declare') |
|
|
console.log('[tribes] unauthorized to declare') |
|
|
throw e |
|
|
throw e |
|
|