refactor(models): Rename Request model
This commit is contained in:
parent
3345571bd8
commit
670290b60b
@ -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(),
|
||||||
|
@ -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"`
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user