mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: use session access_tokens
This commit is contained in:
parent
08cc97f557
commit
52f2235942
74 changed files with 413 additions and 440 deletions
|
|
@ -9,11 +9,14 @@ import { getActivityBlockMediaDirectory } from '@services/media/media'
|
|||
import { useOrg } from '@components/Contexts/OrgContext'
|
||||
import { useCourse } from '@components/Contexts/CourseContext'
|
||||
import { useEditorProvider } from '@components/Contexts/Editor/EditorContext'
|
||||
import { useLHSession } from '@components/Contexts/LHSessionContext'
|
||||
|
||||
function ImageBlockComponent(props: any) {
|
||||
const org = useOrg() as any
|
||||
const course = useCourse() as any
|
||||
const editorState = useEditorProvider() as any
|
||||
const session = useLHSession() as any
|
||||
const access_token = session.data.tokens.access_token;
|
||||
|
||||
const isEditable = editorState.isEditable
|
||||
const [image, setImage] = React.useState(null)
|
||||
|
|
@ -36,7 +39,7 @@ function ImageBlockComponent(props: any) {
|
|||
setIsLoading(true)
|
||||
let object = await uploadNewImageFile(
|
||||
image,
|
||||
props.extension.options.activity.activity_uuid
|
||||
props.extension.options.activity.activity_uuid,access_token
|
||||
)
|
||||
setIsLoading(false)
|
||||
setblockObject(object)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue