Skip to content

Commit 2a5051d

Browse files
committed
Update API
1 parent 1266419 commit 2a5051d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Sources/App/Controllers/RozkladController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ final class RozkladController {
6363
let groupsNames = try await RozkladController.ukrainianAlphabet
6464
.asyncMap { letter -> AllGroupsClientResponse in
6565
let response: ClientResponse = try await client.post(
66-
"http://rozklad.kpi.ua/Schedules/ScheduleGroupSelection.aspx/GetGroups",
66+
"http://epi.kpi.ua/Schedules/ScheduleGroupSelection.aspx/GetGroups",
6767
beforeSend: { clientRequest in
6868
let content = AllGroupClientRequest(prefixText: letter, count: 100)
6969
try clientRequest.content.encode(content)
@@ -79,7 +79,7 @@ final class RozkladController {
7979
return try await groupsNames
8080
.asyncMap { groupName -> [GroupModel] in
8181
let response: ClientResponse = try await client.post(
82-
"http://rozklad.kpi.ua/Schedules/ScheduleGroupSelection.aspx",
82+
"http://epi.kpi.ua/Schedules/ScheduleGroupSelection.aspx",
8383
beforeSend: { clientRequest in
8484
clientRequest.headers.add(
8585
name: .contentType,
@@ -104,7 +104,7 @@ final class RozkladController {
104104

105105
func getLessons(for groupUUID: UUID, request: Request) async throws -> LessonsResponse {
106106
let response = try await request.client.get(
107-
"http://rozklad.kpi.ua/Schedules/ViewSchedule.aspx?g=\(groupUUID.uuidString)"
107+
"http://epi.kpi.ua/Schedules/ViewSchedule.aspx?g=\(groupUUID.uuidString)"
108108
)
109109
let html = try (response.body).htmlString(encoding: .utf8)
110110
let lessons = try LessonsParser().parse(html)

Sources/App/routes.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ func groupsHandler(
6060
) async throws -> AsyncResponseEncodable {
6161
switch route {
6262
case .all:
63-
let controller = RozkladControllerV2()
63+
let controller = RozkladController()
6464
return try await controller.allGroups(request: request)
6565

6666
case let .search(searchQuery):
67-
let controller = RozkladControllerV2()
67+
let controller = RozkladController()
6868
return try await controller.search(request: request, searchQuery: searchQuery)
6969

7070
case .forceRefresh:
@@ -82,7 +82,7 @@ func groupHandler(
8282
) async throws -> AsyncResponseEncodable {
8383
switch route {
8484
case .lessons:
85-
let controller = RozkladControllerV2()
85+
let controller = RozkladController()
8686
return try await controller.getLessons(for: uuid, request: request)
8787
}
8888
}

0 commit comments

Comments
 (0)