feat(tester): add UpdateParticipant endpoint

This commit is contained in:
Vyacheslav1557 2025-03-08 11:44:19 +05:00
parent e1720e7f82
commit dd87d63860
8 changed files with 45 additions and 1 deletions

View file

@ -307,3 +307,20 @@ func (h *TesterHandlers) UpdateContest(c *fiber.Ctx, id int32) error {
return c.SendStatus(fiber.StatusOK)
}
func (h *TesterHandlers) UpdateParticipant(c *fiber.Ctx, params testerv1.UpdateParticipantParams) error {
var req testerv1.UpdateParticipantRequest
err := c.BodyParser(&req)
if err != nil {
return err
}
err = h.contestsUC.UpdateParticipant(c.Context(), params.ParticipantId, models.ParticipantUpdate{
Name: req.Name,
})
if err != nil {
return c.SendStatus(pkg.ToREST(err))
}
return c.SendStatus(fiber.StatusOK)
}