Skip to content

Commit

Permalink
feat: mod toggles for network, paid and explicit content (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilsol authored Aug 27, 2024
1 parent 9161e03 commit 3eba58b
Show file tree
Hide file tree
Showing 20 changed files with 730 additions and 118 deletions.
2 changes: 2 additions & 0 deletions db/schema/mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ func (Mod) Fields() []ent.Field {
field.String("mod_reference").MaxLen(32),
field.Bool("hidden").Default(false),
field.JSON("compatibility", &util.CompatibilityInfo{}).Optional(),
field.Bool("toggle_network_use").Default(false),
field.Bool("toggle_explicit_content").Default(false),
}
}

Expand Down
2 changes: 2 additions & 0 deletions generated/conv/mod.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 22 additions & 18 deletions generated/custom_models.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,29 @@ package generated
import "github.com/99designs/gqlgen/graphql"

type NewMod struct {
Name string `json:"name" validate:"required,min=3,max=32"`
ShortDescription string `json:"short_description" validate:"required,min=16,max=128"`
FullDescription *string `json:"full_description"`
Logo *graphql.Upload `json:"logo"`
SourceURL *string `json:"source_url"`
ModReference string `json:"mod_reference"`
Hidden *bool `json:"hidden"`
TagIDs []string `json:"tagIDs" validate:"dive,min=3,max=24"`
Name string `json:"name" validate:"required,min=3,max=32"`
ShortDescription string `json:"short_description" validate:"required,min=16,max=128"`
FullDescription *string `json:"full_description"`
Logo *graphql.Upload `json:"logo"`
SourceURL *string `json:"source_url"`
ModReference string `json:"mod_reference"`
Hidden *bool `json:"hidden"`
TagIDs []string `json:"tagIDs" validate:"dive,min=3,max=24"`
ToggleNetworkUse *bool `json:"toggle_network_use"`
ToggleExplicitContent *bool `json:"toggle_explicit_content"`
}

type UpdateMod struct {
Name *string `json:"name" validate:"omitempty,min=3,max=32"`
ShortDescription *string `json:"short_description" validate:"omitempty,min=16,max=128"`
FullDescription *string `json:"full_description"`
Logo *graphql.Upload `json:"logo"`
SourceURL *string `json:"source_url"`
ModReference *string `json:"mod_reference"`
Hidden *bool `json:"hidden"`
Compatibility *CompatibilityInfoInput `json:"compatibility"`
Authors []UpdateUserMod `json:"authors"`
TagIDs []string `json:"tagIDs" validate:"dive,min=3,max=24"`
Name *string `json:"name" validate:"omitempty,min=3,max=32"`
ShortDescription *string `json:"short_description" validate:"omitempty,min=16,max=128"`
FullDescription *string `json:"full_description"`
Logo *graphql.Upload `json:"logo"`
SourceURL *string `json:"source_url"`
ModReference *string `json:"mod_reference"`
Hidden *bool `json:"hidden"`
Compatibility *CompatibilityInfoInput `json:"compatibility"`
Authors []UpdateUserMod `json:"authors"`
TagIDs []string `json:"tagIDs" validate:"dive,min=3,max=24"`
ToggleNetworkUse *bool `json:"toggle_network_use"`
ToggleExplicitContent *bool `json:"toggle_explicit_content"`
}
2 changes: 1 addition & 1 deletion generated/ent/internal/schema.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions generated/ent/migrate/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 23 additions & 1 deletion generated/ent/mod.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions generated/ent/mod/mod.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions generated/ent/mod/where.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

130 changes: 130 additions & 0 deletions generated/ent/mod_create.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3eba58b

Please sign in to comment.