Skip to content

Conversation

@inspiredinside
Copy link
Owner

No description provided.

Copy link

@dirtymew dirtymew left a 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)
Copy link

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
Copy link

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)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

по заданию другой код ответа должен быть

Copy link

@dirtymew dirtymew left a 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)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а тут не поправил (

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants