chore: update shortcut name checks

This commit is contained in:
Steven 2023-11-19 23:25:43 +08:00
parent fdee03cc99
commit e9905cbc39

@ -102,6 +102,9 @@ func (s *APIV1Service) registerShortcutRoutes(g *echo.Group) {
Tags: create.Tags,
OgMetadata: &storepb.OpenGraphMetadata{},
}
if create.Name == "" {
return echo.NewHTTPError(http.StatusBadRequest, "name is required")
}
if create.OpenGraphMetadata != nil {
shortcut.OgMetadata = &storepb.OpenGraphMetadata{
Title: create.OpenGraphMetadata.Title,