feat(tester): add UpdateContest endpoint
This commit is contained in:
parent
2bc625363d
commit
e1720e7f82
8 changed files with 45 additions and 1 deletions
|
@ -290,3 +290,20 @@ func (h *TesterHandlers) UpdateProblem(c *fiber.Ctx, id int32) error {
|
|||
|
||||
return c.SendStatus(fiber.StatusOK)
|
||||
}
|
||||
|
||||
func (h *TesterHandlers) UpdateContest(c *fiber.Ctx, id int32) error {
|
||||
var req testerv1.UpdateContestRequest
|
||||
err := c.BodyParser(&req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = h.contestsUC.UpdateContest(c.Context(), id, models.ContestUpdate{
|
||||
Title: req.Title,
|
||||
})
|
||||
if err != nil {
|
||||
return c.SendStatus(pkg.ToREST(err))
|
||||
}
|
||||
|
||||
return c.SendStatus(fiber.StatusOK)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue