20 lines
360 B
Go
20 lines
360 B
Go
package admin
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
|
|
"codeberg.org/nextgo/dbots/internal/db"
|
|
)
|
|
|
|
type UpdateBotStatusRequest struct {
|
|
NewStatus db.BotStatus `json:"new_status"`
|
|
}
|
|
|
|
func (c *UpdateBotStatusRequest) Bind(req *http.Request) error {
|
|
if !c.NewStatus.IsValid() {
|
|
return fmt.Errorf("'%s' is not a valid bot status", c.NewStatus.String())
|
|
}
|
|
|
|
return nil
|
|
}
|