add check for pay
This commit is contained in:
1 parent
7526ffa2b9
commit
c2d30448d7
8 files changed
+45
-11
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { AxiosResponse } from 'axios';
|
||||
import httpClient from '../instance';
|
||||
import { ICourse, ICourseDetailResponse, ICourseListResponse } from './types';
|
||||
import { ICourse, ICourseDetailResponse, ICourseListResponse, ICoursePaidStatusResponse } from './types';
|
||||
|
||||
class CourseService {
|
||||
key = 'courses';
|
||||
@@ -32,6 +32,10 @@ class CourseService {
|
||||
async getAllForTeacher(teacherId: number): Promise<AxiosResponse<ICourseListResponse>> {
|
||||
return await httpClient.get(`/teachers/${teacherId}/${this.key}/`);
|
||||
}
|
||||
|
||||
async paid(id: number): Promise<AxiosResponse<ICoursePaidStatusResponse>> {
|
||||
return await httpClient.get(`/courses/${id}/paid/`);
|
||||
}
|
||||
}
|
||||
|
||||
export const courseService = new CourseService();
|
||||
@@ -19,3 +19,7 @@ export interface ICourseListResponse {
|
||||
}
|
||||
|
||||
export type ICourseDetailResponse = ICourse;
|
||||
|
||||
export interface ICoursePaidStatusResponse {
|
||||
paid: boolean;
|
||||
}
|
||||
Reference in new issue
Block a user