UNPKG

nurekit

Version:

Node.js client for Mindenit Schedule API

33 lines (31 loc) 994 B
import { NurekitError } from "./errors-BDXM9FJP.js"; import { BaseModuleImpl } from "./BaseModule-BIs7tGiS.js"; //#region src/modules/GroupsModule.ts var GroupsModuleImpl = class extends BaseModuleImpl { constructor(baseUrl) { super(`${baseUrl}/groups`); } async getAuditoriums(groupId) { const url = `${this.baseUrl}/${groupId}/auditoriums`; const response = await fetch(url); if (!response.ok) throw new NurekitError(); const data = await response.json(); return data.data; } async getTeachers(groupId) { const url = `${this.baseUrl}/${groupId}/teachers`; const response = await fetch(url); if (!response.ok) throw new NurekitError(); const data = await response.json(); return data.data; } async getSubjects(groupId) { const url = `${this.baseUrl}/${groupId}/subjects`; const response = await fetch(url); if (!response.ok) throw new NurekitError(); const data = await response.json(); return data.data; } }; //#endregion export { GroupsModuleImpl };