Compare commits

...

2 commits

Author SHA1 Message Date
P. Reis
d79292c8f6 Merge branch 'fix-duplicate-url' into 'main'
fix(createWalletSchema): get URL href

See merge request soapbox-pub/ditto!737
2025-05-09 23:16:22 -03:00
P. Reis
760fb1bb43 fix(createWalletSchema): get URL href 2025-05-08 19:24:56 -03:00

View file

@ -151,10 +151,18 @@ route.post('/mint/:quote_id', userMiddleware({ enc: 'nip44' }), async (c) => {
}); });
const createWalletSchema = z.object({ const createWalletSchema = z.object({
mints: z.array(z.string().url()).nonempty().transform((val) => { mints: z.array(
z.string().url()
.transform((url) => new URL(url).href),
).nonempty()
.transform((val) => {
return [...new Set(val)]; return [...new Set(val)];
}), }),
relays: z.array(z.string().url()).transform((val) => { relays: z.array(
z.string().url()
.transform((url) => new URL(url).href),
)
.transform((val) => {
return [...new Set(val)]; return [...new Set(val)];
}), }),
}); });