mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: session auth issues
This commit is contained in:
parent
1708b36818
commit
08cc97f557
70 changed files with 607 additions and 427 deletions
|
|
@ -1,10 +1,14 @@
|
|||
import { getAPIUrl } from '@services/config/config'
|
||||
import { RequestBody, getResponseMetadata } from '@services/utils/ts/requests'
|
||||
import {
|
||||
RequestBody,
|
||||
RequestBodyWithAuthHeader,
|
||||
getResponseMetadata,
|
||||
} from '@services/utils/ts/requests'
|
||||
|
||||
export async function createCourseUpdate(body: any) {
|
||||
export async function createCourseUpdate(body: any, access_token: string) {
|
||||
const result: any = await fetch(
|
||||
`${getAPIUrl()}courses/${body.course_uuid}/updates`,
|
||||
RequestBody('POST', body, null)
|
||||
RequestBodyWithAuthHeader('POST', body, null, access_token)
|
||||
)
|
||||
const res = await getResponseMetadata(result)
|
||||
return res
|
||||
|
|
@ -12,11 +16,12 @@ export async function createCourseUpdate(body: any) {
|
|||
|
||||
export async function deleteCourseUpdate(
|
||||
course_uuid: string,
|
||||
update_uuid: number
|
||||
update_uuid: number,
|
||||
access_token: string
|
||||
) {
|
||||
const result: any = await fetch(
|
||||
`${getAPIUrl()}courses/${course_uuid}/update/${update_uuid}`,
|
||||
RequestBody('DELETE', null, null)
|
||||
RequestBodyWithAuthHeader('DELETE', null, null, access_token)
|
||||
)
|
||||
const res = await getResponseMetadata(result)
|
||||
return res
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue