Browse Source

hm

push-params
Evan Feenstra 4 years ago
parent
commit
b780de9c14
  1. 6
      api/utils/tribes.ts
  2. 6
      dist/api/utils/tribes.js
  3. 2
      dist/api/utils/tribes.js.map

6
api/utils/tribes.ts

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

6
dist/api/utils/tribes.js

@ -125,8 +125,9 @@ function declare_bot({ uuid, name, description, tags, img, price_per_use, owner_
return __awaiter(this, void 0, void 0, function* () {
console.log('=> declare_bot', { uuid, name, description, tags, img, price_per_use, owner_pubkey, unlisted, deleted });
const host = getHost();
console.log('=> https://' + host + '/bots');
try {
yield node_fetch_1.default('https://' + host + '/bots', {
const r = yield node_fetch_1.default('https://' + host + '/bots', {
method: 'POST',
body: JSON.stringify({
uuid, owner_pubkey,
@ -137,7 +138,8 @@ function declare_bot({ uuid, name, description, tags, img, price_per_use, owner_
}),
headers: { 'Content-Type': 'application/json' }
});
// const j = await r.json()
const j = yield r.json();
console.log('=> j', j);
}
catch (e) {
console.log('[tribes] unauthorized to declare');

2
dist/api/utils/tribes.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save