From 6a34f8f6e53eb7e6d1a9b2191fbb355638bb6fc6 Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Thu, 30 Jan 2025 11:07:15 -0300 Subject: [PATCH] fix: use zod array instead of zod set https://github.com/colinhacks/zod/issues/3963 --- src/controllers/api/ditto.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/controllers/api/ditto.ts b/src/controllers/api/ditto.ts index 63f0561a..d747428b 100644 --- a/src/controllers/api/ditto.ts +++ b/src/controllers/api/ditto.ts @@ -347,8 +347,8 @@ export const updateInstanceController: AppController = async (c) => { const createCashuWalletSchema = z.object({ description: z.string(), - relays: z.set(z.string().url()), - mints: z.set(z.string().url()).nonempty(), // must contain at least one item + relays: z.array(z.string().url()), + mints: z.array(z.string().url()).nonempty(), // must contain at least one item name: z.string(), }); @@ -370,7 +370,7 @@ export const createCashuWalletController: AppController = async (c) => { } const { description, relays, mints, name } = result.data; - relays.add(Conf.relay); + relays.push(Conf.relay); const tags: string[][] = []; @@ -379,11 +379,11 @@ export const createCashuWalletController: AppController = async (c) => { tags.push(['description', description]); tags.push(['unit', 'sat']); - for (const mint of mints) { + for (const mint of new Set(mints)) { tags.push(['mint', mint]); } - for (const relay of relays) { + for (const relay of new Set(relays)) { tags.push(['relay', relay]); }