fix(zapController): get kind 0 with store.query
This commit is contained in:
parent
739fea0890
commit
50e7213954
|
@ -471,6 +471,7 @@ const zapController: AppController = async (c) => {
|
||||||
const body = await parseBody(c.req.raw);
|
const body = await parseBody(c.req.raw);
|
||||||
const result = zapSchema.safeParse(body);
|
const result = zapSchema.safeParse(body);
|
||||||
const { signal } = c.req.raw;
|
const { signal } = c.req.raw;
|
||||||
|
const store = c.get('store');
|
||||||
|
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
return c.json({ error: 'Bad request', schema: result.error }, 400);
|
return c.json({ error: 'Bad request', schema: result.error }, 400);
|
||||||
|
@ -497,7 +498,7 @@ const zapController: AppController = async (c) => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
target = await getEvent(account_id, { kind: 0, signal });
|
[target] = await store.query([{ authors: [account_id], kinds: [0], limit: 1 }]);
|
||||||
const meta = n.json().pipe(n.metadata()).catch({}).parse(target?.content);
|
const meta = n.json().pipe(n.metadata()).catch({}).parse(target?.content);
|
||||||
lnurl = getLnurl(meta);
|
lnurl = getLnurl(meta);
|
||||||
if (target && lnurl) {
|
if (target && lnurl) {
|
||||||
|
|
Loading…
Reference in New Issue