:card_box: Add more fields into product
This commit is contained in:
@@ -121,11 +121,13 @@ func updateProduct(c *fiber.Ctx) error {
|
||||
user := c.Locals("nex_user").(*sec.UserInfo)
|
||||
|
||||
var data struct {
|
||||
Icon string `json:"icon"`
|
||||
Name string `json:"name" validate:"required,max=256"`
|
||||
Description string `json:"description" validate:"max=4096"`
|
||||
Introduction string `json:"introduction"`
|
||||
Alias string `json:"alias" validate:"required"`
|
||||
Tags []string `json:"tags"`
|
||||
Previews []string `json:"previews"`
|
||||
Attachments []string `json:"attachments"`
|
||||
}
|
||||
|
||||
@@ -138,9 +140,11 @@ func updateProduct(c *fiber.Ctx) error {
|
||||
return fiber.NewError(fiber.StatusBadRequest, err.Error())
|
||||
}
|
||||
|
||||
product.Icon = data.Icon
|
||||
product.Name = data.Name
|
||||
product.Description = data.Description
|
||||
product.Tags = data.Tags
|
||||
product.Previews = data.Previews
|
||||
product.Meta.Introduction = data.Introduction
|
||||
product.Meta.Attachments = data.Attachments
|
||||
|
||||
|
Reference in New Issue
Block a user