refactor(models): Rename Request model

This commit is contained in:
Nicolai Ort 2024-12-03 18:27:11 +01:00
parent 3345571bd8
commit 670290b60b
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F
2 changed files with 3 additions and 3 deletions

View File

@ -15,11 +15,11 @@ import (
// @Description Generate a contract based on the provided data // @Description Generate a contract based on the provided data
// @Tags contracts // @Tags contracts
// @Accept json // @Accept json
// @Param data body models.Contract true "Contract data" // @Param data body models.ContractRequest true "Contract data"
// @Produce application/pdf // @Produce application/pdf
// @Router /contracts [post] // @Router /contracts [post]
func GenerateContract(c *fiber.Ctx) error { func GenerateContract(c *fiber.Ctx) error {
contract := new(models.Contract) contract := new(models.ContractRequest)
if err := c.BodyParser(contract); err != nil { if err := c.BodyParser(contract); err != nil {
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{ return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
"error": err.Error(), "error": err.Error(),

View File

@ -1,6 +1,6 @@
package models package models
type Contract struct { type ContractRequest struct {
Runners []Runner `json:"runners"` Runners []Runner `json:"runners"`
Locale string `json:"locale" enums:"en,de"` Locale string `json:"locale" enums:"en,de"`
} }