🐛 Fix naming way not match
This commit is contained in:
parent
f4ff82a804
commit
eb78e93cb2
@ -28,7 +28,7 @@ func addChannelMember(c *fiber.Ctx) error {
|
|||||||
alias := c.Params("channel")
|
alias := c.Params("channel")
|
||||||
|
|
||||||
var data struct {
|
var data struct {
|
||||||
AccountName string `json:"account_name" validate:"required"`
|
Target string `json:"target" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := BindAndValidate(c, &data); err != nil {
|
if err := BindAndValidate(c, &data); err != nil {
|
||||||
@ -45,7 +45,7 @@ func addChannelMember(c *fiber.Ctx) error {
|
|||||||
|
|
||||||
var account models.Account
|
var account models.Account
|
||||||
if err := database.C.Where(&models.Account{
|
if err := database.C.Where(&models.Account{
|
||||||
Name: data.AccountName,
|
Name: data.Target,
|
||||||
}).First(&account).Error; err != nil {
|
}).First(&account).Error; err != nil {
|
||||||
return fiber.NewError(fiber.StatusNotFound, err.Error())
|
return fiber.NewError(fiber.StatusNotFound, err.Error())
|
||||||
}
|
}
|
||||||
@ -62,7 +62,7 @@ func removeChannelMember(c *fiber.Ctx) error {
|
|||||||
alias := c.Params("channel")
|
alias := c.Params("channel")
|
||||||
|
|
||||||
var data struct {
|
var data struct {
|
||||||
AccountName string `json:"account_name" validate:"required"`
|
Target string `json:"target" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := BindAndValidate(c, &data); err != nil {
|
if err := BindAndValidate(c, &data); err != nil {
|
||||||
@ -79,7 +79,7 @@ func removeChannelMember(c *fiber.Ctx) error {
|
|||||||
|
|
||||||
var account models.Account
|
var account models.Account
|
||||||
if err := database.C.Where(&models.Account{
|
if err := database.C.Where(&models.Account{
|
||||||
Name: data.AccountName,
|
Name: data.Target,
|
||||||
}).First(&account).Error; err != nil {
|
}).First(&account).Error; err != nil {
|
||||||
return fiber.NewError(fiber.StatusNotFound, err.Error())
|
return fiber.NewError(fiber.StatusNotFound, err.Error())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user