Skip to content

Conversation

@RinatKaumov
Copy link

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 нужно оформить в свой форк репозитория - а не репозиторий задания

по работе тоже есть замечания - см PR

precode.go Outdated
}

w.WriteHeader(http.StatusOK)
w.Write(resp)

Choose a reason for hiding this comment

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

_ , _ = w.Write(resp)

http.Error(w, "ID задачи обязателен", http.StatusBadRequest)
return
}

Choose a reason for hiding this comment

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

тут нужно проверить что такой задачи нет в tasks и если есть вернуть ошибку

return
}

if task.ID == "" {

Choose a reason for hiding this comment

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

отлично что добавил эту проверку

precode.go Outdated

task, ok := tasks[id]
if !ok {
http.Error(w, "Задача не найдена", http.StatusNotFound)

Choose a reason for hiding this comment

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

неверный код ответа - см задание

precode.go Outdated

w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusCreated)
resp, err := json.Marshal(task)

Choose a reason for hiding this comment

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

эндпоинт не предполагает возвращение данных - стоит убрать

precode.go Outdated

w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
resp, err := json.Marshal(map[string]string{"message": "Задача удалена"})

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