MCPcopy Index your code
hub / github.com/chartbrew/chartbrew / _onSaveName

Function _onSaveName

client/src/containers/ProjectSettings.jsx:53–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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);

Callers 1

ProjectSettingsFunction · 0.85

Calls 3

updateProjectFunction · 0.90
changeActiveProjectFunction · 0.90
dispatchFunction · 0.50

Tested by

no test coverage detected