summaryrefslogtreecommitdiff
path: root/internal/processing/app.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-08-25 15:34:33 +0200
committerLibravatar GitHub <noreply@github.com>2021-08-25 15:34:33 +0200
commit2dc9fc1626507bb54417fc4a1920b847cafb27a2 (patch)
tree4ddeac479b923db38090aac8bd9209f3646851c1 /internal/processing/app.go
parentManually approves followers (#146) (diff)
downloadgotosocial-2dc9fc1626507bb54417fc4a1920b847cafb27a2.tar.xz
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
Diffstat (limited to 'internal/processing/app.go')
-rw-r--r--internal/processing/app.go10
1 files changed, 6 insertions, 4 deletions
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
}