course save fix
parent
db3cf0db16
commit
3ba851ae41
|
@ -57,9 +57,15 @@ export function ManageCoursePage({
|
||||||
return Object.keys(errors).length === 0;
|
return Object.keys(errors).length === 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkSlug = () => {
|
||||||
|
if (course.slug) return;
|
||||||
|
course.slug = course.title.replace(/\s+/g, "-").toLowerCase();
|
||||||
|
};
|
||||||
|
|
||||||
function handleSave(event) {
|
function handleSave(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (!formIsValid()) return;
|
if (!formIsValid()) return;
|
||||||
|
checkSlug();
|
||||||
setSaving(true);
|
setSaving(true);
|
||||||
actions
|
actions
|
||||||
.saveCourse(course)
|
.saveCourse(course)
|
||||||
|
|
Loading…
Reference in New Issue