Open
Conversation
AvtoBBus
requested changes
Apr 9, 2026
Collaborator
There was a problem hiding this comment.
Чтобы избежать повторения кода создайте функцию, которая будет выполнять запрос на определённый url, что-то типо такого:
async function sendRequest(url, queryParams = {}, bodyParams = {}) {
// тут нужно добавить все query и body параметры
cosnt response = fetch(API_BASE + url);
// обрабатываем ответ
return result;
}
export async function getStations() {
return await sendRequest('/endpoint-for-stations')
}
Collaborator
There was a problem hiding this comment.
Очень похожий код на то, что было у одного из ваших коллег, поэтому чтобы искупить такой проступок, задание такое:
Примерно с 167 строки у вас начинаются функции рендера различных вещей. Выносите всё это как отдельные компоненты в папке components/
|
|
||
| return () => { | ||
| clearTimeout(timeout); | ||
| map.setTarget(undefined); |
Collaborator
There was a problem hiding this comment.
В удалении таргета нет смысла
Collaborator
There was a problem hiding this comment.
Так же в добавлении к вышеописанному заданию: добавьте алиасы до необходимых папок
Comment on lines
+55
to
+62
| const isRailway = | ||
| transportType.includes('поезд') || | ||
| transportType.includes('электрич') || | ||
| stationType.includes('станц') || | ||
| stationType.includes('платформ') || | ||
| stationType.includes('вокзал') | ||
|
|
||
| if (!isRailway) continue |
Collaborator
There was a problem hiding this comment.
Не самый надежный способ проверять, потому что есть esr_code
| } | ||
| }) | ||
|
|
||
| const PORT = 5001 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.