Files
ncd-fe/src/schemas/relay.ts
marcin mikołajczak 0fc158a7d0 Allow to manage instance relays
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-04-02 11:45:15 +02:00

14 lines
300 B
TypeScript

import z from 'zod';
const relaySchema = z.preprocess((data: any) => {
return { id: data.actor, ...data };
}, z.object({
actor: z.string().catch(''),
id: z.string(),
followed_back: z.boolean().catch(false),
}));
type Relay = z.infer<typeof relaySchema>
export { relaySchema, type Relay };