feat: use session access_tokens

This commit is contained in:
swve 2024-06-01 12:23:01 +01:00
parent 08cc97f557
commit 52f2235942
74 changed files with 413 additions and 440 deletions

View file

@ -1,10 +1,10 @@
import { getAPIUrl } from '@services/config/config'
import { RequestBody } from '@services/utils/ts/requests'
import { RequestBody, RequestBodyWithAuthHeader } from '@services/utils/ts/requests'
export async function submitQuizBlock(activity_id: string, data: any) {
export async function submitQuizBlock(activity_id: string, data: any,access_token:string) {
const result: any = await fetch(
`${getAPIUrl()}blocks/quiz/${activity_id}"`,
RequestBody('POST', data, null)
RequestBodyWithAuthHeader('POST', data, null,access_token)
)
.then((result) => result.json())
.catch((error) => console.log('error', error))