In this PR, we are refactoring two things: - leverage field.defaultValue for Select and MultiSelect settings form (instead of option.isDefault) - use quoted string (ex: "'USD'") for string default values to embrace backend format --------- Co-authored-by: Thaïs Guigon <guigon.thais@gmail.com>
16 lines
324 B
TypeScript
16 lines
324 B
TypeScript
import { z } from 'zod';
|
|
|
|
export const simpleQuotesStringSchema: z.ZodType<
|
|
`'${string}'`,
|
|
z.ZodTypeDef,
|
|
string
|
|
> = z
|
|
.string()
|
|
.refine(
|
|
(value: string): value is `'${string}'` =>
|
|
value.startsWith("'") && value.endsWith("'"),
|
|
{
|
|
message: 'String should be wrapped in simple quotes',
|
|
},
|
|
);
|