From cd39566f5f07038adb46c907d492c3acc489e0bb Mon Sep 17 00:00:00 2001 From: tsmethurst Date: Sun, 7 Mar 2021 22:03:36 +0100 Subject: [PATCH] tiny experiments --- internal/db/postgres.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/db/postgres.go b/internal/db/postgres.go index 3c7af452..a5c4024d 100644 --- a/internal/db/postgres.go +++ b/internal/db/postgres.go @@ -28,6 +28,7 @@ import ( "sync" "time" + "github.com/go-fed/activity/streams" "github.com/go-fed/activity/streams/vocab" "github.com/go-pg/pg/extra/pgdebug" "github.com/go-pg/pg/v10" @@ -239,6 +240,14 @@ func (ps *postgresService) Get(ctx context.Context, id *url.URL) (value vocab.Ty } func (ps *postgresService) Create(ctx context.Context, asType vocab.Type) error { + t, err := streams.NewTypeResolver() + if err != nil { + return err + } + if err := t.Resolve(ctx, asType); err != nil { + return err + } + asType.GetTypeName() return nil }