INNER CODE UNIT · JavaScript

ForgotPassword

SamiurRahmanMukul/Hotel-Room-Booking-System · frontend/pages/auth/forgot-password/index.js:20

function ForgotPassword() {
  const [loading, setLoading] = useState(false);
  const [form] = Form.useForm();
  const router = useRouter();

  const onFinish = (values) => {
    ApiService.post('/api/v1/auth/forgot-password', values)
      .then((response) => {
        setLoading(false);
        if (response?.result_code === 0) {
          notificationWithIcon('success', 'SUCCESS', response?.result?.message || 'Your password reset mail send successful');
          form.resetFields();
          router.push('/auth/login');
        } else {
          notificationWithIcon('error', 'ERROR', 'Sorry! Something went wrong. App server error');
        }
      })
      .catch((err) => {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…