fix class progress admin side
This commit is contained in:
@@ -797,6 +797,7 @@ export async function fetchClassSections(params?: {
|
||||
search?: string
|
||||
schoolYear?: string | null
|
||||
semester?: string | null
|
||||
withStudents?: boolean
|
||||
page?: number
|
||||
perPage?: number
|
||||
}): Promise<ClassSectionsResponse> {
|
||||
@@ -804,6 +805,7 @@ export async function fetchClassSections(params?: {
|
||||
if (params?.search) query.set('search', params.search)
|
||||
if (params?.schoolYear) query.set('school_year', params.schoolYear)
|
||||
if (params?.semester) query.set('semester', params.semester)
|
||||
if (params?.withStudents) query.set('with_students', '1')
|
||||
if (params?.page) query.set('page', String(params.page))
|
||||
if (params?.perPage) query.set('per_page', String(params.perPage))
|
||||
const qs = query.size > 0 ? `?${query.toString()}` : ''
|
||||
|
||||
@@ -34,7 +34,7 @@ export function ClassProgressListPage() {
|
||||
try {
|
||||
const [meta, sections, groups] = await Promise.all([
|
||||
fetchClassProgressMeta(),
|
||||
fetchClassSections({ perPage: 200 }),
|
||||
fetchClassSections({ perPage: 200, withStudents: true }),
|
||||
fetchClassProgressGroups({
|
||||
classSectionId: filters.classSectionId ? Number(filters.classSectionId) : null,
|
||||
status: filters.status || null,
|
||||
|
||||
Reference in New Issue
Block a user