diff --git a/backend/frontend/src/pages/story/CreateStory.js b/backend/frontend/src/pages/story/CreateStory.js index 3b04a810..6f227c35 100644 --- a/backend/frontend/src/pages/story/CreateStory.js +++ b/backend/frontend/src/pages/story/CreateStory.js @@ -11,9 +11,10 @@ import Quill from 'quill' import StoryMap from './StoryMap'; import TagSearch from './TagSearch'; // Adjust the path as needed import Chip from '@mui/material/Chip'; +import { ToastContainer, toast } from 'react-toastify'; +import 'react-toastify/dist/ReactToastify.css'; import { format, parseISO } from 'date-fns'; - let postHeader = null; function CreateStory({ currentTheme }) { @@ -235,6 +236,7 @@ function CreateStory({ currentTheme }) { } catch (error) { console.error('Error submitting story:', error); + toast.error('Please fill all fields correctly'); } }; @@ -487,6 +489,7 @@ function CreateStory({ currentTheme }) { + ); } diff --git a/backend/frontend/src/pages/story/EditStory.js b/backend/frontend/src/pages/story/EditStory.js index c885e414..8d29eec7 100644 --- a/backend/frontend/src/pages/story/EditStory.js +++ b/backend/frontend/src/pages/story/EditStory.js @@ -11,6 +11,8 @@ import Quill from 'quill' import StoryMap from './StoryMap'; import TagSearch from './TagSearch'; // Adjust the path as needed import Chip from '@mui/material/Chip'; +import { ToastContainer, toast } from 'react-toastify'; +import 'react-toastify/dist/ReactToastify.css'; import { format, parseISO } from 'date-fns'; @@ -365,6 +367,7 @@ const parseLocation = (location) => { navigate(`/story/${storyId}`); } catch (error) { console.error('Error submitting story:', error); + toast.error('Please fill all fields correctly'); } }; @@ -619,6 +622,7 @@ const parseLocation = (location) => { + ); }