From 2dc9fc1626507bb54417fc4a1920b847cafb27a2 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Wed, 25 Aug 2021 15:34:33 +0200 Subject: Pg to bun (#148) * start moving to bun * changing more stuff * more * and yet more * tests passing * seems stable now * more big changes * small fix * little fixes --- internal/processing/app.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'internal/processing/app.go') diff --git a/internal/processing/app.go b/internal/processing/app.go index 7da5344ac..4f805572b 100644 --- a/internal/processing/app.go +++ b/internal/processing/app.go @@ -19,6 +19,8 @@ package processing import ( + "context" + "github.com/google/uuid" apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model" "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" @@ -26,7 +28,7 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/oauth" ) -func (p *processor) AppCreate(authed *oauth.Auth, form *apimodel.ApplicationCreateRequest) (*apimodel.Application, error) { +func (p *processor) AppCreate(ctx context.Context, authed *oauth.Auth, form *apimodel.ApplicationCreateRequest) (*apimodel.Application, error) { // set default 'read' for scopes if it's not set, this follows the default of the mastodon api https://docs.joinmastodon.org/methods/apps/ var scopes string if form.Scopes == "" { @@ -61,7 +63,7 @@ func (p *processor) AppCreate(authed *oauth.Auth, form *apimodel.ApplicationCrea } // chuck it in the db - if err := p.db.Put(app); err != nil { + if err := p.db.Put(ctx, app); err != nil { return nil, err } @@ -74,11 +76,11 @@ func (p *processor) AppCreate(authed *oauth.Auth, form *apimodel.ApplicationCrea } // chuck it in the db - if err := p.db.Put(oc); err != nil { + if err := p.db.Put(ctx, oc); err != nil { return nil, err } - mastoApp, err := p.tc.AppToMastoSensitive(app) + mastoApp, err := p.tc.AppToMastoSensitive(ctx, app) if err != nil { return nil, err } -- cgit v1.2.3