This commit is contained in:
parent
8ec486cfc1
commit
440399f8d2
8 changed files with 171 additions and 9 deletions
|
@ -17,7 +17,7 @@ import (
|
|||
"git.mstar.dev/mstar/linstrom/storage-new/dbgen"
|
||||
)
|
||||
|
||||
type ObjectNoteOut struct {
|
||||
type ObjectNote struct {
|
||||
// Context should be set, if needed, by the endpoint handler
|
||||
Context any `json:"@context,omitempty"`
|
||||
|
||||
|
@ -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) (*ObjectNote, 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 := &ObjectNote{
|
||||
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