summaryrefslogtreecommitdiff
path: root/internal/db/postgres.go
diff options
context:
space:
mode:
authorLibravatar tsmethurst <tobi.smethurst@protonmail.com>2021-03-07 22:03:36 +0100
committerLibravatar tsmethurst <tobi.smethurst@protonmail.com>2021-03-07 22:03:36 +0100
commitcd39566f5f07038adb46c907d492c3acc489e0bb (patch)
tree53f17ec0fe44400bb0d791a89315db65ed2bb5d9 /internal/db/postgres.go
parenttiny bit of moving around (diff)
downloadgotosocial-cd39566f5f07038adb46c907d492c3acc489e0bb.tar.xz
tiny experiments
Diffstat (limited to 'internal/db/postgres.go')
-rw-r--r--internal/db/postgres.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/db/postgres.go b/internal/db/postgres.go
index 3c7af4522..a5c4024de 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
}