From 00eb688c540b614a0f3836e8f79160bce554b9d3 Mon Sep 17 00:00:00 2001 From: MeowcaTheoRange Date: Mon, 25 Sep 2023 13:48:47 -0500 Subject: [PATCH] Fix some stuff --- src/components/cards/ClanCard/ClanCard.tsx | 8 +++--- src/types/client/clan.ts | 31 +++++++++++++++++++--- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/components/cards/ClanCard/ClanCard.tsx b/src/components/cards/ClanCard/ClanCard.tsx index 9ec40c2..f23e8d3 100644 --- a/src/components/cards/ClanCard/ClanCard.tsx +++ b/src/components/cards/ClanCard/ClanCard.tsx @@ -24,7 +24,9 @@ export default function ClanCard({ theme: clan.color ? Color3.fromRGB(...clan.color) : undefined }} > - +
- +

- +

link diff --git a/src/types/client/clan.ts b/src/types/client/clan.ts index 65ffe8c..abcbe34 100644 --- a/src/types/client/clan.ts +++ b/src/types/client/clan.ts @@ -59,7 +59,13 @@ export const SubmitClanSchema = yup .min(1) .max(20), description: yup.string().max(10000).ensure(), - url: yup.string().notRequired().url(), + url: yup + .string() + .notRequired() + .url() + .transform(v => { + return v.length <= 0 ? undefined : v; + }), color: yup .tuple([ yup.number().min(0).max(255).required(), @@ -76,9 +82,26 @@ export const SubmitClanSchema = yup fanfiction: PolicySchema.required() }) .required(), - pfp: yup.string().notRequired().url(), - bgimage: yup.string().notRequired().url(), - css: yup.string().notRequired(), + pfp: yup + .string() + .notRequired() + .url() + .transform(v => { + return v.length <= 0 ? undefined : v; + }), + bgimage: yup + .string() + .notRequired() + .url() + .transform(v => { + return v.length <= 0 ? undefined : v; + }), + css: yup + .string() + .notRequired() + .transform(v => { + return v.length <= 0 ? undefined : v; + }), code: yup.string().notRequired().max(256, "Too secure!!") // flairs: yup.array().of(ClientFlairSchema).required(), })