fix
Deploy banu-front / deploy (push) Successful in 1m20s

This commit is contained in:
sajjadtalkhabi
2026-06-27 20:07:58 +03:30
parent 2c617258f4
commit e700609236
22 changed files with 236 additions and 177 deletions
@@ -119,8 +119,6 @@ const { data: session, isLoading } = useStudentSessionQuery(sessionId, {
enabled: () => !!sessionId.value,
})
// The homework for this session comes from the dedicated endpoint (the session
// payload itself doesn't embed homeworks).
const homeworkFilters = computed(() => ({ sessionId: sessionId.value }))
const homeworkPagination = ref({ page: 1, perPage: 20 })
const { data: homeworksData } = useStudentHomeworksListQuery(homeworkFilters, homeworkPagination, {
@@ -152,7 +150,14 @@ const homeworkId = computed(
)
const uploadHomeworkFile = async (file) => {
const fd = objectToFormData({ file, purpose: 'homework_file', context: 'homework' })
// The backend validates allowed extensions per `purpose`: `homework_file`
// accepts documents/images only, so a recorded voice must go up as `voice`.
const isAudio = (file?.type || '').startsWith('audio/')
const fd = objectToFormData({
file,
purpose: isAudio ? 'voice' : 'homework_file',
context: 'homework',
})
const response = await uploadMediaMutation.mutateAsync(fd)
const payload = response?.data ?? response
return payload?.id ?? null