Overview¶
This page provides all the routes accessible under school administrator namespace.
Feat: Holiday Calendar¶
Route: /school/${schoolId}/admin/holiday-calendar¶
Features¶
- Displays the calendar holidays.
- Marks a date as a holiday.
- Removes a date from the list of holidays.
Components¶
HolidayCalendar: Displays the holidays calendar. Adds, displays and deletes the holidays.- Location:
/src/lib/components/school-admin/HolidayCalendar.svelte'
- Location:
API Calls¶
GET-/api/v1/school/calendar_days/search_and_filter?q[date_gteq]=${startDate}&q[date_lteq]=${endDate}Z&q[sorts]=date%20asc&per_page=100, fetcehs the list of holidays.POST-/api/v1/school/calendar_days/${dateId}, marks a date as a holiday.PATCH-/api/v1/school/calendar_days/${dateId}, removes the date as a holiday.
Discussion¶
- Fetches the calendar holidays using the API call
1. - Marks a date as holiday using the API call
2. - Delets the holiday using the API call
3.
Tab: School Staff¶
Route: /school/${schoolId}/admin/school-staff¶
Features¶
- Fetches the list of users (administrators).
- Archives the users.
- Redirects to
/school/${schoolId}/admin/school-staff/create-staff?kind=${accessRole}&role=in order to create a new user.
Components¶
TopTabs: Displays all the users under various accesses.- Location:
/src/lib/components/shared/TopTabs.svelte'
- Location:
AddStaffCard: Adds a new staff.- Location:
/src/lib/components/school-admin/AddStaffCard.svelte
- Location:
SchoolStaffCard: Displays the list of staff.- Location:
/src/lib/components/school-admin/SchoolStaffCard.svelte
- Location:
API Calls¶
GET-/api/v1/school/profiles/search_and_filter?all=true&per_page=75&page=1&q[user_name_cont]=&q[is_archived_eq]=false&q[is_testing_eq]=false&q[accesses_role_eq]=${accessRole}, fetches the list of users under each access role.PATCH-/api/v1/school/profiles/${userId}, archives the users.
Discussion¶
- Fetches the list of users available using the API call
1. - Archives or unarchives the users using the API call
2.
Route: /school/${schoolId}/admin/school-staff/create-staff?kind=${accessRole}&role=¶
Features¶
- Creates a new user.
API Calls¶
POST-/api/v1/users, creates a new user.GET-/users?per_page=1000&email=${emailId}, fetches the newly created user details.POST-/api/v1/school/profiles?all=true, creates a user profile.POST-/api/v1/school/accesses, creates a new access.
Discussion¶
Route: /school/${schoolId}/admin/school-staff/${userId}?kind=${accessRole}&role=${accessName}¶
Features¶
- Updates the user.
API Call¶
GET-/api/v1/users/${userId}, fetches the user details.PATCH-/api/v1/users/${userId}, updates the user.
Discussion¶
- Fetches the user details using the API call
1. - Updates the user info using the API call
2.
Tab: Classrooms¶
Route: /school/${schoolId}/admin/classrooms¶
Features¶
- Displays all the classrooms data.
- Edits the order of the classrooms.
- Displays all the users and accesses of a classroom.
- Redirects to
/school/8a2c0d37-944f-4829-8dc1-4697ecb084a0/admin/classrooms/${classroomId}/create-access?role=${accessRole}, in order to create a new access for a user.
Components¶
AddStaffCard: Adds a new staff.- Location:
/src/lib/components/school-admin/AddStaffCard.svelte'
- Location:
SchoolStaffCard: Displays the list of users.- Location:
/src/lib/components/school-admin/SchoolStaffCard.svelte'
- Location:
API Calls¶
GET-/api/v1/school/classrooms?per_page=200, fetches all the classroom details.GET-/api/v1/school/profiles?all=true&classroom_id=${classroomId}, fetches all the users in the classroom.
Discussion¶
- Fetches all the classroom details and the users in each classroom using the API calls
1&2.
Route: /school/${schoolId}/admin/classrooms/${classroomId}/create-access?role=${accessRole}¶
Features¶
- Adds or removes access to or from the selected users.
API Calls¶
GET-/api/v1/school/profiles/search_and_filter?all=true&per_page=75&page=1&q[user_name_cont]=&q[is_archived_eq]=false&q[is_testing_eq]=false&q[accesses_role_eq]=${accessRole}, fetches all the users available for the role.POST-/api/v1/school/accesses/batch_create, creates access for the selected users.POST-/api/v1/school/accesses/batch_destroy, removes access for the selected users.
Discussion¶
- Fetches all the users and their access roles data using the API call
1. - Creates and deletes access for the users using the API calls
2&3.
Route: /school/${schoolId}/admin/classrooms/create-classroom¶
Features¶
- Creates or deletes a classroom.
Components¶
ClassRow: shows the classroom row with grades.- Location:
/src/lib/components/school-admin/ClassRow.svelte'
- Location:
EmptyClassRow: displays an empty row.- Location:
/src/lib/components/school-admin/EmptyClassRow.svelte'
- Location:
API Calls¶
POST-/api/v1/school/classrooms/batch_create, creates a classroom.POST-/api/v1/school/classrooms/batch_destroy, deletes new classroom.
Discussion¶
- Creates and deletes a classroom usng the API calls
1&2.
Tab: Materials Library¶
Refer Tab: Material Library. All the features and API calls are similar.¶
Tab: All Students¶
Route: /school/${schoolId}/admin/students¶
Features¶
- Displays all the students of all the classrooms including unassigned.
- Archives or unarchives a student.
- Downloads all the students data.
- Searches the student as per the queryString.
API Calls¶
PATCH-/api/v1/school/students/${studentId}, archives or unarchives a student.GET-/api/v1/school/students?is_archived=${true or false}&per_page=50&page=1, fetches all the archived and unarchived students data.GET-/api/v1/school/students?is_archived=true&name=4{queryString}&per_page=50&page=1, fetches the student as per the query string.GET-/api/v1/schools/me, fetches the school data.
Discussion¶
- Archives or unarchives a student using the API call
1. - Fetches all the archived and unarchived students using the API call
2. - Fetches the student as per the query string using the API call
3.
Tab: Reports¶
Route: /school/${schoolId}/admin/reports¶
Features¶
- Displays all the reports.
- Creates a report.
- Archives the report.
- Refer Feat: Classroom Reports, the features and API calls are similar.
API Calls¶
GET-/api/v1/school/reports?is_archived=false&page=1, fetches all the rerports.PATCH-/api/v1/school/reports/${reportId}, archives the report.POST-api/v1/school/reports/${reportId}/prepare_report, creates a new report.GET-/api/v1/school/reports/${reportId}, fetches the report details.
Discussion¶
- Fetches and archives the reports using the API calls
1&2. - Creates a new report and fetches the details using the API call
3&4respectively. - Refer Feat: Classroom Reports, the features and API calls are similar.