Prevent form submit if loading

This commit is contained in:
2020-02-04 07:18:29 +00:00
parent 1ebb1f64ad
commit ee520b8c3f
6 changed files with 17 additions and 0 deletions
+2
View File
@@ -151,6 +151,7 @@ export function InstructorClassDetail(props) {
const { id } = useParams();
const handleSubmit = (e) => {
if (loading) return;
setLoading(true);
setSuccess(false);
requester('/sessions/'+id+'/', 'PUT', token, input)
@@ -202,6 +203,7 @@ export function InstructorClassList(props) {
const [success, setSuccess] = useState(false);
const handleSubmit = (e) => {
if (loading) return;
setLoading(true);
setSuccess(false);
const data = { ...input, course: course.id };