Skip to content

Commit 8cff62f

Browse files
committed
Merge branch '4.0.0-dev' into bivas-v4
2 parents b8b40af + aff2c8c commit 8cff62f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

assets/src/js/frontend/learning-area/sidebar.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ interface ResetProgressPayload {
1616

1717
interface ResetProgressResponse {
1818
success: boolean;
19+
status_code?: number;
1920
message?: string;
2021
data?: {
2122
redirect_to: string;
@@ -54,8 +55,9 @@ export const sidebarComponent = ({
5455
(payload) => wpAjaxInstance.post(endpoints.RESET_COURSE_PROGRESS, payload),
5556
{
5657
onSuccess: (response) => {
57-
if (response.success && response.data?.redirect_to) {
58+
if (response.status_code === 200 && response.data?.redirect_to) {
5859
window.location.href = response.data.redirect_to;
60+
modal.closeModal(this.resetModalId);
5961
}
6062
},
6163
onError: (error: AxiosError) => {

0 commit comments

Comments
 (0)