🔧 chore(service.go): add default value for category field to improve data consistency and prevent null values

This commit is contained in:
pluja 2023-10-31 17:59:06 +01:00
parent 56ce1519b2
commit ba8680beb5

View File

@ -26,6 +26,7 @@ func (Service) Fields() []ent.Field {
field.String("description").NotEmpty().StructTag(`json:"description"`),
field.String("logo_url").NotEmpty().StructTag(`json:"logo_url"`),
field.String("referral").Default("").StructTag(`json:"referral"`),
field.String("category").Default("others").StructTag(`json:"category"`),
field.String("listing_comment").Default("").StructTag(`json:"listing_comment"`),
field.String("tags").StructTag(`json:"tags"`),
field.Strings("urls").StructTag(`json:"urls"`),