Skip to content

Commit

Permalink
Display error toast on project deletion failure
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtitherington committed Oct 28, 2023
1 parent 7947fb2 commit 2832488
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const CreateProjectModal = ({ isOpen, onClose }: CreateProjectModalProps)
const onSubmit = () => {
close();
toast.success("Project created successfully");
//toast.custom(t => <Toast customMessage="Project created successfully" toast={t} />);
};

const { formik } = useCreateProject({ onSubmit: onSubmit });
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/features/projects/hooks/useProjectSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useFormik } from 'formik';
import { useEffect, useState } from 'react';
import { useProjectsStore } from '../stores/useProjectsStore';
import { useNavigate } from 'react-router';
import toast from 'react-hot-toast';


interface FormValues {
Expand Down Expand Up @@ -45,7 +46,7 @@ const useSettings = ({ projectName: initialProjectName}: FormValues) => {
onDelete?.();
navigate('/flows');
} catch (error) {
//TODO: Toast
toast.error("An error occurred when trying to delete this project");
setErrors(['An error occurred']);
} finally {
setLoading(false);
Expand Down

0 comments on commit 2832488

Please sign in to comment.