fix msg
This commit is contained in:
@@ -5,6 +5,7 @@ import { useForm } from 'react-hook-form'
|
||||
import { Link, useOutletContext } from 'react-router'
|
||||
import { PatternFormat } from 'react-number-format'
|
||||
import { zodResolver } from '@hookform/resolvers/zod'
|
||||
import { toast } from 'sonner'
|
||||
|
||||
import { Button } from '@repo/ui/components/ui/button'
|
||||
import {
|
||||
@@ -35,6 +36,7 @@ import {
|
||||
AlertDescription,
|
||||
AlertTitle
|
||||
} from '@repo/ui/components/ui/alert'
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export async function action({ request, context }: Route.ActionArgs) {
|
||||
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 (
|
||||
<Form {...form}>
|
||||
<form onSubmit={handleSubmit(onSubmit)}>
|
||||
|
||||
@@ -113,7 +113,7 @@ def _create_user(*, user: User, password: str):
|
||||
item={
|
||||
'sk': '0',
|
||||
'email_verified': False,
|
||||
'createdDate': now_,
|
||||
'createDate': now_,
|
||||
# Post-migration (users): uncomment the folloing line
|
||||
# 'created_at': now_,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user