Follow accept works and messags are pushed as expected
Some checks failed
/ docker (push) Failing after 2m50s
Some checks failed
/ docker (push) Failing after 2m50s
This commit is contained in:
parent
9a3a330b1d
commit
ff6a730e58
10 changed files with 482 additions and 19 deletions
|
@ -17,7 +17,7 @@ import (
|
|||
"git.mstar.dev/mstar/linstrom/storage-new/dbgen"
|
||||
)
|
||||
|
||||
type objectNoteOut struct {
|
||||
type ObjectNoteOut struct {
|
||||
// Context should be set, if needed, by the endpoint handler
|
||||
Context any `json:"@context,omitempty"`
|
||||
|
||||
|
@ -48,7 +48,7 @@ type objectNoteOut struct {
|
|||
func objectNote(w http.ResponseWriter, r *http.Request) {
|
||||
id := r.PathValue("id")
|
||||
log := hlog.FromRequest(r)
|
||||
note, err := noteFromStorage(r.Context(), id)
|
||||
note, err := NoteFromStorage(r.Context(), id)
|
||||
switch err {
|
||||
case gorm.ErrRecordNotFound:
|
||||
webutils.ProblemDetailsStatusOnly(w, http.StatusNotFound)
|
||||
|
@ -73,12 +73,12 @@ func objectNote(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
}
|
||||
|
||||
func noteFromStorage(ctx context.Context, id string) (*objectNoteOut, error) {
|
||||
func NoteFromStorage(ctx context.Context, id string) (*ObjectNoteOut, error) {
|
||||
note, err := dbgen.Note.Where(dbgen.Note.ID.Eq(id)).Preload(dbgen.Note.Creator).First()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
data := &objectNoteOut{
|
||||
data := &ObjectNoteOut{
|
||||
Id: config.GlobalConfig.General.GetFullPublicUrl() + "/api/activitypub/note/" + id,
|
||||
Type: "Note",
|
||||
Published: note.CreatedAt,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue