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/models"
)
type ActivityCreateOut struct {
type ActivityCreate struct {
Context any `json:"@context,omitempty"`
Id string `json:"id"`
Type string `json:"type"`
@ -56,7 +56,7 @@ func activityCreate(w http.ResponseWriter, r *http.Request) {
// Does not set the context for the activity, in case the activity is embedded
// in another activity or object. That's the responsibility of the handler
// getting the final result
func CreateFromStorage(ctx context.Context, id string) (*ActivityCreateOut, error) {
func CreateFromStorage(ctx context.Context, id string) (*ActivityCreate, error) {
// log := log.Ctx(ctx)
a := dbgen.Activity
activity, err := a.Where(a.Type.Eq(string(models.ActivityCreate))).
@ -71,7 +71,7 @@ func CreateFromStorage(ctx context.Context, id string) (*ActivityCreateOut, erro
if err != nil {
return nil, err
}
out := ActivityCreateOut{
out := ActivityCreate{
Id: config.GlobalConfig.General.GetFullPublicUrl() + "/api/activitypub/create/" + id,
Type: "Create",
Actor: note.AttributedTo,