Make performer name mandatory in graphQL (#273) (#841)

This commit is contained in:
com1234475
2020-10-21 01:27:16 +01:00
committed by GitHub
parent 147d0067f5
commit 3832c8505a
5 changed files with 6 additions and 8 deletions

View File

@@ -13,7 +13,7 @@ import (
func (r *mutationResolver) PerformerCreate(ctx context.Context, input models.PerformerCreateInput) (*models.Performer, error) {
// generate checksum from performer name rather than image
checksum := utils.MD5FromString(*input.Name)
checksum := utils.MD5FromString(input.Name)
var imageData []byte
var err error
@@ -33,9 +33,7 @@ func (r *mutationResolver) PerformerCreate(ctx context.Context, input models.Per
CreatedAt: models.SQLiteTimestamp{Timestamp: currentTime},
UpdatedAt: models.SQLiteTimestamp{Timestamp: currentTime},
}
if input.Name != nil {
newPerformer.Name = sql.NullString{String: *input.Name, Valid: true}
}
newPerformer.Name = sql.NullString{String: input.Name, Valid: true}
if input.URL != nil {
newPerformer.URL = sql.NullString{String: *input.URL, Valid: true}
}