mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: assignments activity page init
This commit is contained in:
parent
182cd73001
commit
29600d9b6c
12 changed files with 564 additions and 105 deletions
|
|
@ -138,3 +138,25 @@ export async function updateReferenceFile(
|
|||
const res = await getResponseMetadata(result)
|
||||
return res
|
||||
}
|
||||
|
||||
|
||||
export async function updateSubFile(
|
||||
file: any,
|
||||
assignmentTaskUUID: string,
|
||||
assignmentUUID: string,
|
||||
access_token: string
|
||||
) {
|
||||
|
||||
// Send file thumbnail as form data
|
||||
const formData = new FormData()
|
||||
|
||||
if (file) {
|
||||
formData.append('sub_file', file)
|
||||
}
|
||||
const result: any = await fetch(
|
||||
`${getAPIUrl()}assignments/${assignmentUUID}/tasks/${assignmentTaskUUID}/sub_file`,
|
||||
RequestBodyFormWithAuthHeader('POST', formData, null, access_token)
|
||||
)
|
||||
const res = await getResponseMetadata(result)
|
||||
return res
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue