-
Notifications
You must be signed in to change notification settings - Fork 0
API #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
API #1
Conversation
dirtymew
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Привет Никита
PR теперь верно оформлен
API верно описано - но по реализации есть что поправить
precode.go
Outdated
| } | ||
| w.Header().Set("Content-Type", "application/json") | ||
| w.WriteHeader(http.StatusOK) | ||
| w.Write(resp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ , _ = w.Write(resp)
тут стоит либо явно проигнорировать ошибку или ее логировать
| return | ||
| } | ||
|
|
||
| tasks[task.ID] = task |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут нужно сначала проверить что такой задачи еще нет - если есть вернуть пользователю ошибку
precode.go
Outdated
| id := chi.URLParam(r, "id") | ||
| task, ok := tasks[id] | ||
| if !ok { | ||
| http.Error(w, "Задача не найдена", http.StatusNoContent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
по заданию другой код ответа должен быть
dirtymew
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Никита
все ок - зачет
|
|
||
| w.Header().Set("Content-Type", "application/json") | ||
| w.WriteHeader(http.StatusOK) | ||
| w.Write(resp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а тут не поправил (
No description provided.