Omit NEXT_REDIRECT error output

This commit is contained in:
Sam Becker 2025-01-05 15:54:41 -06:00
parent 9d564181dc
commit dd88e75413

View File

@ -282,7 +282,11 @@ export default function PhotoForm({
? createPhotoAction
: updatePhotoAction
)(data)
.catch(e => setFormActionErrorMessage(e.message))}
.catch(e => {
if (e.message !== 'NEXT_REDIRECT') {
setFormActionErrorMessage(e.message);
}
})}
onSubmit={() => {
setFormActionErrorMessage('');
(document.activeElement as HTMLElement)?.blur?.();