mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-01 15:20:29 +00:00
linter autofix
This commit is contained in:
parent
4297111ab4
commit
a60047e390
13 changed files with 18 additions and 24 deletions
|
@ -12,7 +12,7 @@ import (
|
|||
|
||||
type (
|
||||
GroupInvitationCreate struct {
|
||||
Uses int `json:"uses" validate:"required,min=1,max=100"`
|
||||
Uses int `json:"uses" validate:"required,min=1,max=100"`
|
||||
ExpiresAt time.Time `json:"expiresAt"`
|
||||
}
|
||||
|
||||
|
|
|
@ -233,7 +233,6 @@ func (ctrl *V1Controller) HandleGetAllCustomFieldValues() errchain.HandlerFunc {
|
|||
}
|
||||
|
||||
return adapters.Query(fn, http.StatusOK)
|
||||
|
||||
}
|
||||
|
||||
// HandleItemsImport godocs
|
||||
|
|
|
@ -39,7 +39,6 @@ func (ctrl *V1Controller) HandleItemAttachmentCreate() errchain.HandlerFunc {
|
|||
if err != nil {
|
||||
log.Err(err).Msg("failed to parse multipart form")
|
||||
return validate.NewRequestError(errors.New("failed to parse multipart form"), http.StatusBadRequest)
|
||||
|
||||
}
|
||||
|
||||
errs := validate.NewFieldErrors()
|
||||
|
|
|
@ -55,8 +55,8 @@ type (
|
|||
|
||||
ItemCreate struct {
|
||||
ImportRef string `json:"-"`
|
||||
ParentID uuid.UUID `json:"parentId" extensions:"x-nullable"`
|
||||
Name string `json:"name" validate:"required,min=1,max=255"`
|
||||
ParentID uuid.UUID `json:"parentId" extensions:"x-nullable"`
|
||||
Name string `json:"name" validate:"required,min=1,max=255"`
|
||||
Description string `json:"description" validate:"max=1000"`
|
||||
AssetID AssetID `json:"-"`
|
||||
|
||||
|
@ -66,7 +66,7 @@ type (
|
|||
}
|
||||
|
||||
ItemUpdate struct {
|
||||
ParentID uuid.UUID `json:"parentId" extensions:"x-nullable,x-omitempty"`
|
||||
ParentID uuid.UUID `json:"parentId" extensions:"x-nullable,x-omitempty"`
|
||||
ID uuid.UUID `json:"id"`
|
||||
AssetID AssetID `json:"assetId"`
|
||||
Name string `json:"name"`
|
||||
|
@ -108,7 +108,7 @@ type (
|
|||
ItemPatch struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
Quantity *int `json:"quantity,omitempty" extensions:"x-nullable,x-omitempty"`
|
||||
ImportRef *string `json:"-,omitempty" extensions:"x-nullable,x-omitempty"`
|
||||
ImportRef *string `json:"-,omitempty" extensions:"x-nullable,x-omitempty"`
|
||||
}
|
||||
|
||||
ItemSummary struct {
|
||||
|
|
|
@ -77,7 +77,6 @@ func TestItemsRepository_RecursiveRelationships(t *testing.T) {
|
|||
updated, err = tRepos.Items.GetOne(context.Background(), child.ID)
|
||||
assert.NoError(t, err)
|
||||
assert.Nil(t, updated.Parent)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,14 +19,14 @@ type LabelRepository struct {
|
|||
|
||||
type (
|
||||
LabelCreate struct {
|
||||
Name string `json:"name" validate:"required,min=1,max=255"`
|
||||
Name string `json:"name" validate:"required,min=1,max=255"`
|
||||
Description string `json:"description" validate:"max=255"`
|
||||
Color string `json:"color"`
|
||||
}
|
||||
|
||||
LabelUpdate struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
Name string `json:"name" validate:"required,min=1,max=255"`
|
||||
Name string `json:"name" validate:"required,min=1,max=255"`
|
||||
Description string `json:"description" validate:"max=255"`
|
||||
Color string `json:"color"`
|
||||
}
|
||||
|
|
|
@ -21,12 +21,12 @@ type LocationRepository struct {
|
|||
type (
|
||||
LocationCreate struct {
|
||||
Name string `json:"name"`
|
||||
ParentID uuid.UUID `json:"parentId" extensions:"x-nullable"`
|
||||
ParentID uuid.UUID `json:"parentId" extensions:"x-nullable"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
LocationUpdate struct {
|
||||
ParentID uuid.UUID `json:"parentId" extensions:"x-nullable"`
|
||||
ParentID uuid.UUID `json:"parentId" extensions:"x-nullable"`
|
||||
ID uuid.UUID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
|
|
|
@ -23,7 +23,7 @@ type MaintenanceEntryRepository struct {
|
|||
type MaintenanceEntryCreate struct {
|
||||
CompletedDate types.Date `json:"completedDate"`
|
||||
ScheduledDate types.Date `json:"scheduledDate"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
Description string `json:"description"`
|
||||
Cost float64 `json:"cost,string"`
|
||||
}
|
||||
|
@ -152,7 +152,6 @@ func (r *MaintenanceEntryRepository) GetLog(ctx context.Context, groupID, itemID
|
|||
maintenanceentry.DateNotNil(),
|
||||
maintenanceentry.DateNEQ(time.Time{}),
|
||||
))
|
||||
|
||||
} else if query.Scheduled {
|
||||
q = q.Where(maintenanceentry.And(
|
||||
maintenanceentry.Or(
|
||||
|
|
|
@ -35,15 +35,15 @@ func NewNotifierRepository(db *ent.Client) *NotifierRepository {
|
|||
|
||||
type (
|
||||
NotifierCreate struct {
|
||||
Name string `json:"name" validate:"required,min=1,max=255"`
|
||||
Name string `json:"name" validate:"required,min=1,max=255"`
|
||||
IsActive bool `json:"isActive"`
|
||||
URL string `json:"url" validate:"required,shoutrrr"`
|
||||
URL string `json:"url" validate:"required,shoutrrr"`
|
||||
}
|
||||
|
||||
NotifierUpdate struct {
|
||||
Name string `json:"name" validate:"required,min=1,max=255"`
|
||||
Name string `json:"name" validate:"required,min=1,max=255"`
|
||||
IsActive bool `json:"isActive"`
|
||||
URL *string `json:"url" validate:"omitempty,shoutrrr" extensions:"x-nullable" `
|
||||
URL *string `json:"url" validate:"omitempty,shoutrrr" extensions:"x-nullable"`
|
||||
}
|
||||
|
||||
NotifierOut struct {
|
||||
|
|
|
@ -116,7 +116,6 @@ func TestAuthTokenRepo_PurgeExpiredTokens(t *testing.T) {
|
|||
assert.NotNil(createdToken)
|
||||
|
||||
createdTokens = append(createdTokens, createdToken)
|
||||
|
||||
}
|
||||
|
||||
// Purge expired tokens
|
||||
|
|
|
@ -16,7 +16,7 @@ const (
|
|||
|
||||
type Config struct {
|
||||
conf.Version
|
||||
Mode string `yaml:"mode" conf:"default:development"` // development or production
|
||||
Mode string `yaml:"mode" conf:"default:development"` // development or production
|
||||
Web WebConfig `yaml:"web"`
|
||||
Storage Storage `yaml:"storage"`
|
||||
Log LoggerConf `yaml:"logger"`
|
||||
|
@ -27,13 +27,13 @@ type Config struct {
|
|||
}
|
||||
|
||||
type Options struct {
|
||||
AllowRegistration bool `yaml:"disable_registration" conf:"default:true"`
|
||||
AllowRegistration bool `yaml:"disable_registration" conf:"default:true"`
|
||||
AutoIncrementAssetID bool `yaml:"auto_increment_asset_id" conf:"default:true"`
|
||||
}
|
||||
|
||||
type DebugConf struct {
|
||||
Enabled bool `yaml:"enabled" conf:"default:false"`
|
||||
Port string `yaml:"port" conf:"default:4000"`
|
||||
Port string `yaml:"port" conf:"default:4000"`
|
||||
}
|
||||
|
||||
type WebConfig struct {
|
||||
|
|
|
@ -6,6 +6,6 @@ const (
|
|||
|
||||
type Storage struct {
|
||||
// Data is the path to the root directory
|
||||
Data string `yaml:"data" conf:"default:./.data"`
|
||||
Data string `yaml:"data" conf:"default:./.data"`
|
||||
SqliteUrl string `yaml:"sqlite-url" conf:"default:./.data/homebox.db?_pragma=busy_timeout=1000&_pragma=journal_mode=WAL&_fk=1"`
|
||||
}
|
||||
|
|
|
@ -52,7 +52,6 @@ func init() {
|
|||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Checks a struct for validation errors and returns any errors the occur. This
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue