Restored ToJSON encoding (sans Integration) for Post APIs (#19279)

* Restored ToJSON encoding sans Integration for Post APIs

* PR feedback + GetPost test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Lev
2022-01-21 08:25:33 -08:00
коммит произвёл GitHub
родитель 956e21cfa2
Коммит a0e870bed2
6 изменённых файлов: 82 добавлений и 12 удалений

Просмотреть файл

@@ -6,6 +6,7 @@ package model
import (
"encoding/json"
"errors"
"io"
"net/http"
"regexp"
"sort"
@@ -227,6 +228,11 @@ func (o *Post) ToJSON() (string, error) {
return string(b), err
}
func (o *Post) EncodeJSON(w io.Writer) error {
o.StripActionIntegrations()
return json.NewEncoder(w).Encode(o)
}
type GetPostsSinceOptions struct {
UserId string
ChannelId string