mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: add updates functionality to app
This commit is contained in:
parent
f0e5fa925d
commit
8a2ccb2534
6 changed files with 147 additions and 53 deletions
23
apps/web/services/courses/updates.ts
Normal file
23
apps/web/services/courses/updates.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { getAPIUrl } from '@services/config/config'
|
||||
import { RequestBody, getResponseMetadata } from '@services/utils/ts/requests'
|
||||
|
||||
export async function createCourseUpdate(body: any) {
|
||||
const result: any = await fetch(
|
||||
`${getAPIUrl()}courses/${body.course_uuid}/updates`,
|
||||
RequestBody('POST', body, null)
|
||||
)
|
||||
const res = await getResponseMetadata(result)
|
||||
return res
|
||||
}
|
||||
|
||||
export async function deleteCourseUpdate(
|
||||
course_uuid: string,
|
||||
update_uuid: number
|
||||
) {
|
||||
const result: any = await fetch(
|
||||
`${getAPIUrl()}courses/${course_uuid}/update/${update_uuid}`,
|
||||
RequestBody('DELETE', null, null)
|
||||
)
|
||||
const res = await getResponseMetadata(result)
|
||||
return res
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue