mirror of
https://github.com/aljazceru/ditto.git
synced 2025-12-29 11:14:25 +01:00
Remove zod schemas that we can get from NSchema
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { NSchema as n } from '@nostrify/nostrify';
|
||||
|
||||
import { type AppController } from '@/app.ts';
|
||||
import { Conf } from '@/config.ts';
|
||||
import { jsonServerMetaSchema } from '@/schemas/nostr.ts';
|
||||
import { serverMetaSchema } from '@/schemas/nostr.ts';
|
||||
import { Storages } from '@/storages.ts';
|
||||
|
||||
const instanceController: AppController = async (c) => {
|
||||
@@ -8,7 +10,7 @@ const instanceController: AppController = async (c) => {
|
||||
const { signal } = c.req.raw;
|
||||
|
||||
const [event] = await Storages.db.query([{ kinds: [0], authors: [Conf.pubkey], limit: 1 }], { signal });
|
||||
const meta = jsonServerMetaSchema.parse(event?.content);
|
||||
const meta = n.json().pipe(serverMetaSchema).parse(event?.content);
|
||||
|
||||
/** Protocol to use for WebSocket URLs, depending on the protocol of the `LOCAL_DOMAIN`. */
|
||||
const wsProtocol = protocol === 'http:' ? 'ws:' : 'wss:';
|
||||
|
||||
Reference in New Issue
Block a user