mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: format with prettier
This commit is contained in:
parent
03fb09c3d6
commit
a147ad6610
164 changed files with 11257 additions and 8154 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { OrderPayload } from "@components/Dashboard/Course/EditCourseStructure/EditCourseStructure";
|
||||
import { getAPIUrl } from "@services/config/config";
|
||||
import { RequestBody, errorHandling } from "@services/utils/ts/requests";
|
||||
import { OrderPayload } from '@components/Dashboard/Course/EditCourseStructure/EditCourseStructure'
|
||||
import { getAPIUrl } from '@services/config/config'
|
||||
import { RequestBody, errorHandling } from '@services/utils/ts/requests'
|
||||
|
||||
/*
|
||||
This file includes only POST, PUT, DELETE requests
|
||||
|
|
@ -9,38 +9,59 @@ import { RequestBody, errorHandling } from "@services/utils/ts/requests";
|
|||
|
||||
//TODO : depreciate this function
|
||||
export async function getCourseChaptersMetadata(course_uuid: any, next: any) {
|
||||
const result = await fetch(`${getAPIUrl()}chapters/meta/course_${course_uuid}`, RequestBody("GET", null, next));
|
||||
const res = await errorHandling(result);
|
||||
return res;
|
||||
const result = await fetch(
|
||||
`${getAPIUrl()}chapters/meta/course_${course_uuid}`,
|
||||
RequestBody('GET', null, next)
|
||||
)
|
||||
const res = await errorHandling(result)
|
||||
return res
|
||||
}
|
||||
|
||||
export async function updateChaptersMetadata(course_uuid: any, data: any) {
|
||||
const result: any = await fetch(`${getAPIUrl()}chapters/course/course_${course_uuid}/order`, RequestBody("PUT", data, null));
|
||||
const res = await errorHandling(result);
|
||||
return res;
|
||||
const result: any = await fetch(
|
||||
`${getAPIUrl()}chapters/course/course_${course_uuid}/order`,
|
||||
RequestBody('PUT', data, null)
|
||||
)
|
||||
const res = await errorHandling(result)
|
||||
return res
|
||||
}
|
||||
|
||||
export async function updateChapter(coursechapter_id: any, data: any) {
|
||||
const result: any = await fetch(`${getAPIUrl()}chapters/${coursechapter_id}`, RequestBody("PUT", data, null));
|
||||
const res = await errorHandling(result);
|
||||
return res;
|
||||
const result: any = await fetch(
|
||||
`${getAPIUrl()}chapters/${coursechapter_id}`,
|
||||
RequestBody('PUT', data, null)
|
||||
)
|
||||
const res = await errorHandling(result)
|
||||
return res
|
||||
}
|
||||
|
||||
export async function updateCourseOrderStructure(course_uuid: any, data: OrderPayload) {
|
||||
const result: any = await fetch(`${getAPIUrl()}chapters/course/${course_uuid}/order`, RequestBody("PUT", data, null));
|
||||
const res = await errorHandling(result);
|
||||
return res;
|
||||
export async function updateCourseOrderStructure(
|
||||
course_uuid: any,
|
||||
data: OrderPayload
|
||||
) {
|
||||
const result: any = await fetch(
|
||||
`${getAPIUrl()}chapters/course/${course_uuid}/order`,
|
||||
RequestBody('PUT', data, null)
|
||||
)
|
||||
const res = await errorHandling(result)
|
||||
return res
|
||||
}
|
||||
|
||||
export async function createChapter(data: any) {
|
||||
const result: any = await fetch(`${getAPIUrl()}chapters/`, RequestBody("POST", data, null));
|
||||
const res = await errorHandling(result);
|
||||
const result: any = await fetch(
|
||||
`${getAPIUrl()}chapters/`,
|
||||
RequestBody('POST', data, null)
|
||||
)
|
||||
const res = await errorHandling(result)
|
||||
|
||||
return res;
|
||||
return res
|
||||
}
|
||||
|
||||
export async function deleteChapter(coursechapter_id: any) {
|
||||
const result: any = await fetch(`${getAPIUrl()}chapters/${coursechapter_id}`, RequestBody("DELETE", null, null));
|
||||
const res = await errorHandling(result);
|
||||
return res;
|
||||
const result: any = await fetch(
|
||||
`${getAPIUrl()}chapters/${coursechapter_id}`,
|
||||
RequestBody('DELETE', null, null)
|
||||
)
|
||||
const res = await errorHandling(result)
|
||||
return res
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue