()
| 51 | }, []); |
| 52 | |
| 53 | const _onSaveName = () => { |
| 54 | if (!projectName) { |
| 55 | setNameError(true); |
| 56 | return; |
| 57 | } |
| 58 | |
| 59 | setLoading(true); |
| 60 | |
| 61 | dispatch(updateProject({ project_id: project.id, data: { name: projectName } })) |
| 62 | .then((data) => { |
| 63 | if (data.error) { |
| 64 | throw new Error(data.error); |
| 65 | } |
| 66 | setLoading(false); |
| 67 | dispatch(changeActiveProject(project.id)); |
| 68 | toast.success("Dashboard name updated!"); |
| 69 | }) |
| 70 | .catch(() => { |
| 71 | setLoading(false); |
| 72 | toast.error("There was a problem updating the dashboard name. Please try again."); |
| 73 | }); |
| 74 | }; |
| 75 | |
| 76 | const _onRemoveConfirmation = () => { |
| 77 | setRemoveModal(true); |
no test coverage detected