From 7fed35dd0451767aeaaacd97858b3c38257bf15d Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Thu, 27 Jun 2024 01:01:47 +0800 Subject: [PATCH] :bug: Fix status validation issue --- .idea/workspace.xml | 6 +++--- pkg/internal/server/api/statuses_api.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2c61561..aa950a7 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,7 +4,7 @@ - @@ -177,7 +176,8 @@ - true diff --git a/pkg/internal/server/api/statuses_api.go b/pkg/internal/server/api/statuses_api.go index 6c097cc..83ab87b 100644 --- a/pkg/internal/server/api/statuses_api.go +++ b/pkg/internal/server/api/statuses_api.go @@ -63,7 +63,7 @@ func setStatus(c *fiber.Ctx) error { var req struct { Type string `json:"type" validate:"required"` Label string `json:"label" validate:"required"` - Attitude uint `json:"attitude" validate:"required"` + Attitude uint `json:"attitude"` IsNoDisturb bool `json:"is_no_disturb"` IsInvisible bool `json:"is_invisible"` ClearAt *time.Time `json:"clear_at"` @@ -105,7 +105,7 @@ func editStatus(c *fiber.Ctx) error { var req struct { Type string `json:"type" validate:"required"` Label string `json:"label" validate:"required"` - Attitude uint `json:"attitude" validate:"required"` + Attitude uint `json:"attitude"` IsNoDisturb bool `json:"is_no_disturb"` IsInvisible bool `json:"is_invisible"` ClearAt *time.Time `json:"clear_at"`