Commit 70c2226 1 parent 5f1e66a commit 70c2226 Copy full SHA for 70c2226
File tree 3 files changed +5
-24
lines changed
api/src/user-course-progress
3 files changed +5
-24
lines changed Original file line number Diff line number Diff line change @@ -12,21 +12,8 @@ import { UserCourseProgressService } from "./user-course-progress.service";
12
12
export class UserProgressController {
13
13
constructor ( private readonly userCourseProgressService : UserCourseProgressService ) { }
14
14
15
- @UseGuards ( AuthGuard )
16
15
@Get ( "/recent-course-packs" )
17
- async getUserRecentCoursePacks ( @User ( ) user : UserEntity , @Query ( "limit" ) limit : number ) {
18
- const recentCoursePacks = await this . userCourseProgressService . getUserRecentCoursePacks (
19
- user . userId ,
20
- limit || 4 ,
21
- ) ;
22
- return recentCoursePacks ;
23
- }
24
-
25
- @Get ( "/recent-course-packs-by-user-id" )
26
- async getUserRecentCoursePacksByUserId (
27
- @Query ( "userId" ) userId ?: string ,
28
- @Query ( "limit" ) limit ?: number ,
29
- ) {
16
+ async getUserRecentCoursePacks ( @Query ( "userId" ) userId ?: string , @Query ( "limit" ) limit ?: number ) {
30
17
const recentCoursePacks = await this . userCourseProgressService . getUserRecentCoursePacks (
31
18
userId ,
32
19
limit || 4 ,
Original file line number Diff line number Diff line change @@ -26,15 +26,9 @@ export async function fetchUpdateCourseProgress(userProgressUpdate: UserProgress
26
26
) ;
27
27
}
28
28
29
- export async function fetchUserRecentCoursePacks ( ) {
30
- return await http . get < UserRecentCoursePackResponse [ ] , UserRecentCoursePackResponse [ ] > (
31
- `/user-course-progress/recent-course-packs` ,
32
- ) ;
33
- }
34
-
35
- export async function fetchUserRecentCoursePacksByUserId ( userId : string , limit = 4 ) {
29
+ export async function fetchUserRecentCoursePacks ( userId : string , limit = 4 ) {
36
30
return await http . get < unknown , UserRecentCoursePackResponse [ ] > (
37
- `/user-course-progress/recent-course-packs-by-user-id ` ,
31
+ `/user-course-progress/recent-course-packs` ,
38
32
{
39
33
params : {
40
34
userId,
Original file line number Diff line number Diff line change 1
1
import { ref } from "vue" ;
2
2
3
3
import type { UserRecentCoursePackResponse } from "~/api/userCourseProgress" ;
4
- import { fetchUserRecentCoursePacksByUserId } from "~/api/userCourseProgress" ;
4
+ import { fetchUserRecentCoursePacks } from "~/api/userCourseProgress" ;
5
5
6
6
const coursePacks = ref < UserRecentCoursePackResponse [ ] > ( [ ] ) ;
7
7
@@ -14,7 +14,7 @@ export function useRecentCoursePack(options: UseRecentCoursePackOptions) {
14
14
const { userId, limit = 4 } = options || { } ;
15
15
16
16
async function fetchCoursePacks ( ) {
17
- coursePacks . value = await fetchUserRecentCoursePacksByUserId ( userId , limit ) ;
17
+ coursePacks . value = await fetchUserRecentCoursePacks ( userId , limit ) ;
18
18
}
19
19
20
20
return {
You can’t perform that action at this time.
0 commit comments