Make title optional for non-user created galleries (#3110)

This commit is contained in:
WithoutPants
2022-11-10 14:19:13 +11:00
committed by GitHub
parent c83ebf7c1c
commit 9df66024d1
4 changed files with 15 additions and 3 deletions

View File

@@ -177,8 +177,8 @@ func (r *mutationResolver) galleryUpdate(ctx context.Context, input models.Galle
if input.Title != nil {
// ensure title is not empty
if *input.Title == "" {
return nil, errors.New("title must not be empty")
if *input.Title == "" && originalGallery.IsUserCreated() {
return nil, errors.New("title must not be empty for user-created galleries")
}
updatedGallery.Title = models.NewOptionalString(*input.Title)