We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b8b40af + aff2c8c commit 8cff62fCopy full SHA for 8cff62f
1 file changed
assets/src/js/frontend/learning-area/sidebar.ts
@@ -16,6 +16,7 @@ interface ResetProgressPayload {
16
17
interface ResetProgressResponse {
18
success: boolean;
19
+ status_code?: number;
20
message?: string;
21
data?: {
22
redirect_to: string;
@@ -54,8 +55,9 @@ export const sidebarComponent = ({
54
55
(payload) => wpAjaxInstance.post(endpoints.RESET_COURSE_PROGRESS, payload),
56
{
57
onSuccess: (response) => {
- if (response.success && response.data?.redirect_to) {
58
+ if (response.status_code === 200 && response.data?.redirect_to) {
59
window.location.href = response.data.redirect_to;
60
+ modal.closeModal(this.resetModalId);
61
}
62
},
63
onError: (error: AxiosError) => {
0 commit comments