Add Image field to posts.Posts (#26)

This commit is contained in:
Janos Dobronszki
2020-11-12 11:22:20 +01:00
committed by GitHub
parent f3a1cb06fa
commit e369086903
3 changed files with 49 additions and 28 deletions

View File

@@ -65,6 +65,7 @@ func (p *Posts) Save(ctx context.Context, req *proto.SaveRequest, rsp *proto.Sav
Slug: postSlug,
Created: time.Now().Unix(),
Metadata: req.Metadata,
Image: req.Image,
}
err := p.savePost(ctx, nil, post)
if err != nil {
@@ -83,6 +84,7 @@ func (p *Posts) Save(ctx context.Context, req *proto.SaveRequest, rsp *proto.Sav
Created: oldPost.Created,
Updated: time.Now().Unix(),
Metadata: req.Metadata,
Image: req.Image,
}
if len(req.Title) > 0 {
post.Title = req.Title