From 96424f667957c3e5eb6c0a7c8b2c0586ba2cc4a9 Mon Sep 17 00:00:00 2001 From: Chintan Joshi Date: Wed, 30 Oct 2024 16:43:29 +0300 Subject: [PATCH] fix : error on file upload post.success is not a function any more. https://stackoverflow.com/questions/46394793/typeerror-post-success-is-not-a-function --- edx_sga/static/js/src/edx_sga.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/edx_sga/static/js/src/edx_sga.js b/edx_sga/static/js/src/edx_sga.js index 3ac38cf9..5f32ef5e 100644 --- a/edx_sga/static/js/src/edx_sga.js +++ b/edx_sga/static/js/src/edx_sga.js @@ -36,7 +36,7 @@ function StaffGradedAssignmentXBlock(runtime, element) { var content = $(element).find('#sga-content').html(template(state)); $(content).find('.finalize-upload').on('click', function () { - $.post(finalizeUploadUrl).success( + $.post(finalizeUploadUrl).done( function (state) { render(state); } @@ -256,7 +256,7 @@ function StaffGradedAssignmentXBlock(runtime, element) { // No errors form.find('.ccx-enter-grade-spinner').show(); $.post(enterGradeUrl, form.serialize()) - .success(renderStaffGrading) + .done(renderStaffGrading) .fail(function () { form.find('.ccx-enter-grade-spinner').hide(); }); @@ -271,7 +271,7 @@ function StaffGradedAssignmentXBlock(runtime, element) { event.preventDefault(); if (row.data('score')) { // if there is no grade then it is pointless to call api. - $.get(url).success(renderStaffGrading).fail(function () { + $.get(url).done(renderStaffGrading).fail(function () { $(this).prop('disabled', false); form.find('.ccx-enter-grade-spinner').hide(); }); @@ -456,7 +456,7 @@ function StaffGradedAssignmentXBlock(runtime, element) { tries = 1; function makeLoopingRequest() { - $.get(url).success(function (response) { + $.get(url).done(function (response) { if (checkSuccessFn(response)) { deferred.resolve(response); } else if (tries < maxTries) {