And create activities work-ish
All checks were successful
/ docker (push) Successful in 4m18s

This commit is contained in:
Melody Becker 2025-05-16 21:31:17 +02:00
parent 8ec486cfc1
commit 440399f8d2
8 changed files with 171 additions and 9 deletions

View file

@ -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,