mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-04-19 19:01:19 +00:00
Fix query param
This commit is contained in:
parent
74d84bd308
commit
89f8c69289
@ -16,11 +16,11 @@ const useCheckCourseProgress = () => {
|
||||
const courseId = userCourse.courseId;
|
||||
|
||||
try {
|
||||
const response = await axios.get(`/api/users/${userId}/courses?courseSlug=${courseId}`);
|
||||
const response = await axios.get(`/api/users/${userId}/courses/${courseId}`);
|
||||
const isCompleted = response.data === true;
|
||||
|
||||
if (isCompleted && !userCourse.completed) {
|
||||
await axios.post(`/api/users/${userId}/courses/${courseId}`, {
|
||||
await axios.post(`/api/users/${userId}/courses?courseSlug=${courseId}`, {
|
||||
completed: true,
|
||||
completedAt: new Date().toISOString(),
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user