feat(tester): add UpdateContest endpoint

This commit is contained in:
Vyacheslav1557 2025-03-07 17:04:19 +05:00
parent 2bc625363d
commit e1720e7f82
8 changed files with 45 additions and 1 deletions

View file

@ -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)
}