Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/api/admin/hintsAPI.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import axiosInstance from "../axiosInstance.js";

export default {
async getHintStatus(hintId) {
return await axiosInstance({
method: "get",
url: `/api/info/hint/${hintId}`
});
},

async takeHint(hintId) {
return await axiosInstance({
method: "post",
url: `/api/info/hint/${hintId}`
});
}
};
7 changes: 6 additions & 1 deletion src/api/axiosInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ axiosInstance.interceptors.response.use(
"/auth/register",
"/api/submit/challenge"
];

// For hint errors, pass through the error response
if (error.response && error.response.config.url.includes("/api/info/hint")) {
return Promise.reject(error);
}

if (!error.response) {
router.push("/error/networkerror");
} else if (ignoreErrorPagesPath.includes(error.response.config.url)) {
Expand All @@ -49,7 +55,6 @@ axiosInstance.interceptors.response.use(
default:
return error;
}

Promise.reject(error);
}
}
Expand Down
Loading