INNER CODE UNIT · JavaScript

onFinish

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

  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) => {
        setLoading(false);
        notificationWithIcon('error', 'ERROR', err?.response?.data?.result?.error?.message || err?.response?.data?.result?.error || 'Sorry! Something went wrong. App server error');
      });
  };

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…