Skip to content

Commit

Permalink
fix: fix checkers, remove useless error handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
OneLiL05 committed Oct 25, 2023
1 parent 6dbdaab commit 8e54a88
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 17 deletions.
10 changes: 0 additions & 10 deletions packages/nurekit/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
import { Nurekit } from "./client.js";

export * from "./client.js";
export { IAuditorium, IGroup, ISchedule, ISubject, ITeacher } from "./types/index.js";

const nurekit = new Nurekit()

console.log(await nurekit.groups.getSchedule({
groupName: "пзпі-23-5",
startTime: "2023-09-22",
endTime: "2023-09-23"
}))
1 change: 0 additions & 1 deletion packages/nurekit/src/modules/auditoriums.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ export class AuditoriumsModule {
`/api/schedule?type=auditory&id=${auditoriumId}&start_time=${startTimestamp}&end_time=${endTimestamp}`,
)
.then((res) => res.data)
.catch(handleAxiosError);

const result = transformSchedule(rawSchedule);

Expand Down
7 changes: 2 additions & 5 deletions packages/nurekit/src/modules/groups.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class GroupsModule {
public async findOne(name: string): Promise<IGroup> {
const groups = await this.findMany();

const group = groups.find((group) => group.name === name.toUpperCase());
const group = groups.find((group) => group.name.toLowerCase() === name);

if (!group) {
throw new Error("Group with such name doesn't exist");
Expand Down Expand Up @@ -132,10 +132,7 @@ export class GroupsModule {
`/api/schedule?type=group&id=${groupId}&start_time=${startTimestamp}&end_time=${endTimestamp}`,
)
.then((res) => res.data)
.catch(handleAxiosError);

const result = transformSchedule(rawSchedule);

return result;
return transformSchedule(rawSchedule);
}
}
1 change: 0 additions & 1 deletion packages/nurekit/src/modules/teachers.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ export class TeachersModule {
`/api/schedule?type=teacher&id=${teacherId}&start_time=${startTimestamp}&end_time=${endTimestamp}`,
)
.then((res) => res.data)
.catch(handleAxiosError);

const result = transformSchedule(rawSchedule);

Expand Down

0 comments on commit 8e54a88

Please sign in to comment.