Browse Source

Added change.Submit to addStory, editStory and removeStory

1.0
Gisle Aune 6 years ago
parent
commit
9b705e6514
  1. 17
      resolver/story.go

17
resolver/story.go

@ -151,6 +151,12 @@ func (r *MutationResolver) AddStory(ctx context.Context, args *StoryAddArgs) (*S
return nil, err return nil, err
} }
change.Submit("Story", "add", user.ID, story.ID, map[string]interface{}{
"name": args.Input.Name,
"category": args.Input.Category,
"author": args.Input.Author,
})
return &StoryResolver{S: story}, nil return &StoryResolver{S: story}, nil
} }
@ -269,6 +275,15 @@ func (r *MutationResolver) EditStory(ctx context.Context, args *StoryEditArgs) (
return nil, err return nil, err
} }
change.Submit("Story", "edit", user.ID, story.ID, map[string]interface{}{
"name": args.Input.Name,
"category": args.Input.Category,
"author": args.Input.Author,
"open": args.Input.Open,
"listed": args.Input.Listed,
"fictionalDate": args.Input.FictionalDate,
})
return &StoryResolver{S: story}, nil return &StoryResolver{S: story}, nil
} }
@ -298,6 +313,8 @@ func (r *MutationResolver) RemoveStory(ctx context.Context, args *StoryRemoveArg
return nil, err return nil, err
} }
change.Submit("Story", "remove", user.ID, story.ID, nil)
return &StoryResolver{S: story}, nil return &StoryResolver{S: story}, nil
} }

Loading…
Cancel
Save