Browse Source

cleaniup

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

8
api/utils/tribes.ts

@ -100,11 +100,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 })
const host = getHost() const host = getHost()
console.log('=> https://' + host + '/bots')
try { try {
const r = await fetch('https://' + host + '/bots', { await fetch('https://' + host + '/bots', {
method: 'POST', method: 'POST',
body: JSON.stringify({ body: JSON.stringify({
uuid, owner_pubkey, uuid, owner_pubkey,
@ -115,8 +113,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) // console.log('=> j',j)
} catch (e) { } catch (e) {
console.log('[tribes] unauthorized to declare') console.log('[tribes] unauthorized to declare')
throw e throw e

8
dist/api/utils/tribes.js

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