Skip to content

Instantly share code, notes, and snippets.

@isaacbatst
Last active March 16, 2023 19:25
Show Gist options
  • Save isaacbatst/32070c56306a30c3a30f26d305e23077 to your computer and use it in GitHub Desktop.
Save isaacbatst/32070c56306a30c3a30f26d305e23077 to your computer and use it in GitHub Desktop.
// undefined = nenhum parâmetro é necessário, enquanto que:
// z.object({
// id: z.string({
// invalid_type_error: 'INVALID_ID_TYPE',
// required_error: 'REQUIRED_ID',
// }),
//}) representa uma rota que espera os parâmetros no seguinte formato: { id: string }
const appRoutes = {
home: undefined,
myAccount: undefined,
products: undefined,
customerService: undefined,
notifications: undefined,
contracts: undefined,
contractVersionSelector: z.object({
id: z.string({
invalid_type_error: 'INVALID_ID_TYPE',
required_error: 'REQUIRED_ID',
}),
}, {invalid_type_error: 'INVALID_LINK_PARAMS', required_error: 'REQUIRED_LINK_PARAMS'}),
contract: z.object({
id: z.string({
invalid_type_error: 'INVALID_ID_TYPE',
required_error: 'REQUIRED_ID',
}),
}, {invalid_type_error: 'INVALID_LINK_PARAMS', required_error: 'REQUIRED_LINK_PARAMS'}),
contractWithdraw: z.object({
id: z.string({
invalid_type_error: 'INVALID_ID_TYPE',
required_error: 'REQUIRED_ID',
}),
}, {invalid_type_error: 'INVALID_LINK_PARAMS', required_error: 'REQUIRED_LINK_PARAMS'}),
transactions: undefined,
product: z.object({
id: z.string({
invalid_type_error: 'INVALID_ID_TYPE',
required_error: 'REQUIRED_ID',
}),
}, {invalid_type_error: 'INVALID_LINK_PARAMS', required_error: 'REQUIRED_LINK_PARAMS'}),
myAccountData: undefined,
changePassword: undefined,
changeEmail: undefined,
notificationsSettings: undefined,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment