mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: protect paid courses
This commit is contained in:
parent
b7f09885df
commit
3988ee1d4b
9 changed files with 266 additions and 33 deletions
|
|
@ -10,6 +10,15 @@ export async function getPaymentConfigs(orgId: number, access_token: string) {
|
|||
return res;
|
||||
}
|
||||
|
||||
export async function checkPaidAccess(courseId: number, orgId: number, access_token: string) {
|
||||
const result = await fetch(
|
||||
`${getAPIUrl()}payments/${orgId}/courses/${courseId}/access`,
|
||||
RequestBodyWithAuthHeader('GET', null, null, access_token)
|
||||
);
|
||||
const res = await errorHandling(result);
|
||||
return res;
|
||||
}
|
||||
|
||||
export async function createPaymentConfig(orgId: number, data: any, access_token: string) {
|
||||
const result = await fetch(
|
||||
`${getAPIUrl()}payments/${orgId}/config`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue