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