feat(country-province-city): add, edit functionality
This commit is contained in:
@@ -2,6 +2,7 @@ import React, { useState } from 'react';
|
||||
import { useNavigate, Link } from 'react-router-dom';
|
||||
import { CreditCard } from 'lucide-react';
|
||||
import { forgotPassword } from '../services/api';
|
||||
import { getErrorMessage, getSuccessMessage } from '../utils/errorHandler';
|
||||
|
||||
const ForgotPassword = () => {
|
||||
const [email, setEmail] = useState('');
|
||||
@@ -18,9 +19,9 @@ const ForgotPassword = () => {
|
||||
|
||||
try {
|
||||
const res = await forgotPassword(email);
|
||||
setSuccess(res?.message || 'If the email exists, a reset link was sent.');
|
||||
setSuccess(getSuccessMessage(res) || 'If the email exists, a reset link was sent.');
|
||||
} catch (err) {
|
||||
setError(typeof err === 'string' ? err : 'Request failed. Please try again.');
|
||||
setError(getErrorMessage(err));
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user