Skip to content

Commit 3eba58b

Browse files
authored
feat: mod toggles for network, paid and explicit content (#86)
1 parent 9161e03 commit 3eba58b

20 files changed

+730
-118
lines changed

db/schema/mod.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ func (Mod) Fields() []ent.Field {
4040
field.String("mod_reference").MaxLen(32),
4141
field.Bool("hidden").Default(false),
4242
field.JSON("compatibility", &util.CompatibilityInfo{}).Optional(),
43+
field.Bool("toggle_network_use").Default(false),
44+
field.Bool("toggle_explicit_content").Default(false),
4345
}
4446
}
4547

generated/conv/mod.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated/custom_models.go

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,29 @@ package generated
33
import "github.com/99designs/gqlgen/graphql"
44

55
type NewMod struct {
6-
Name string `json:"name" validate:"required,min=3,max=32"`
7-
ShortDescription string `json:"short_description" validate:"required,min=16,max=128"`
8-
FullDescription *string `json:"full_description"`
9-
Logo *graphql.Upload `json:"logo"`
10-
SourceURL *string `json:"source_url"`
11-
ModReference string `json:"mod_reference"`
12-
Hidden *bool `json:"hidden"`
13-
TagIDs []string `json:"tagIDs" validate:"dive,min=3,max=24"`
6+
Name string `json:"name" validate:"required,min=3,max=32"`
7+
ShortDescription string `json:"short_description" validate:"required,min=16,max=128"`
8+
FullDescription *string `json:"full_description"`
9+
Logo *graphql.Upload `json:"logo"`
10+
SourceURL *string `json:"source_url"`
11+
ModReference string `json:"mod_reference"`
12+
Hidden *bool `json:"hidden"`
13+
TagIDs []string `json:"tagIDs" validate:"dive,min=3,max=24"`
14+
ToggleNetworkUse *bool `json:"toggle_network_use"`
15+
ToggleExplicitContent *bool `json:"toggle_explicit_content"`
1416
}
1517

1618
type UpdateMod struct {
17-
Name *string `json:"name" validate:"omitempty,min=3,max=32"`
18-
ShortDescription *string `json:"short_description" validate:"omitempty,min=16,max=128"`
19-
FullDescription *string `json:"full_description"`
20-
Logo *graphql.Upload `json:"logo"`
21-
SourceURL *string `json:"source_url"`
22-
ModReference *string `json:"mod_reference"`
23-
Hidden *bool `json:"hidden"`
24-
Compatibility *CompatibilityInfoInput `json:"compatibility"`
25-
Authors []UpdateUserMod `json:"authors"`
26-
TagIDs []string `json:"tagIDs" validate:"dive,min=3,max=24"`
19+
Name *string `json:"name" validate:"omitempty,min=3,max=32"`
20+
ShortDescription *string `json:"short_description" validate:"omitempty,min=16,max=128"`
21+
FullDescription *string `json:"full_description"`
22+
Logo *graphql.Upload `json:"logo"`
23+
SourceURL *string `json:"source_url"`
24+
ModReference *string `json:"mod_reference"`
25+
Hidden *bool `json:"hidden"`
26+
Compatibility *CompatibilityInfoInput `json:"compatibility"`
27+
Authors []UpdateUserMod `json:"authors"`
28+
TagIDs []string `json:"tagIDs" validate:"dive,min=3,max=24"`
29+
ToggleNetworkUse *bool `json:"toggle_network_use"`
30+
ToggleExplicitContent *bool `json:"toggle_explicit_content"`
2731
}

generated/ent/internal/schema.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated/ent/migrate/schema.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated/ent/mod.go

Lines changed: 23 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated/ent/mod/mod.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated/ent/mod/where.go

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated/ent/mod_create.go

Lines changed: 130 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)