fix msg
This commit is contained in:
@@ -5,6 +5,7 @@ import { useForm } from 'react-hook-form'
|
|||||||
import { Link, useOutletContext } from 'react-router'
|
import { Link, useOutletContext } from 'react-router'
|
||||||
import { PatternFormat } from 'react-number-format'
|
import { PatternFormat } from 'react-number-format'
|
||||||
import { zodResolver } from '@hookform/resolvers/zod'
|
import { zodResolver } from '@hookform/resolvers/zod'
|
||||||
|
import { toast } from 'sonner'
|
||||||
|
|
||||||
import { Button } from '@repo/ui/components/ui/button'
|
import { Button } from '@repo/ui/components/ui/button'
|
||||||
import {
|
import {
|
||||||
@@ -35,6 +36,7 @@ import {
|
|||||||
AlertDescription,
|
AlertDescription,
|
||||||
AlertTitle
|
AlertTitle
|
||||||
} from '@repo/ui/components/ui/alert'
|
} from '@repo/ui/components/ui/alert'
|
||||||
|
import { useEffect } from 'react'
|
||||||
|
|
||||||
export async function action({ request, context }: Route.ActionArgs) {
|
export async function action({ request, context }: Route.ActionArgs) {
|
||||||
const body = await request.json()
|
const body = await request.json()
|
||||||
@@ -71,6 +73,18 @@ export default function Route({}: Route.ComponentProps) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (fetcher.data?.ok) {
|
||||||
|
toast.success('Seu perfil foi atualizado.')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (fetcher.data?.error?.type) {
|
||||||
|
case 'RateLimitExceededError':
|
||||||
|
toast.error('Seu limite diário de atualizações foi atingido.')
|
||||||
|
}
|
||||||
|
}, [fetcher.data])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form {...form}>
|
<Form {...form}>
|
||||||
<form onSubmit={handleSubmit(onSubmit)}>
|
<form onSubmit={handleSubmit(onSubmit)}>
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ def _create_user(*, user: User, password: str):
|
|||||||
item={
|
item={
|
||||||
'sk': '0',
|
'sk': '0',
|
||||||
'email_verified': False,
|
'email_verified': False,
|
||||||
'createdDate': now_,
|
'createDate': now_,
|
||||||
# Post-migration (users): uncomment the folloing line
|
# Post-migration (users): uncomment the folloing line
|
||||||
# 'created_at': now_,
|
# 'created_at': now_,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user