summaryrefslogtreecommitdiff
path: root/internal/api/client/account
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/api/client/account
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/api/client/account')
-rw-r--r--internal/api/client/account/accountcreate.go2
-rw-r--r--internal/api/client/account/accountget.go2
-rw-r--r--internal/api/client/account/accountupdate.go2
-rw-r--r--internal/api/client/account/accountupdate_test.go2
-rw-r--r--internal/api/client/account/accountverify.go2
-rw-r--r--internal/api/client/account/block.go2
-rw-r--r--internal/api/client/account/follow.go2
-rw-r--r--internal/api/client/account/followers.go2
-rw-r--r--internal/api/client/account/following.go2
-rw-r--r--internal/api/client/account/relationships.go2
-rw-r--r--internal/api/client/account/statuses.go2
-rw-r--r--internal/api/client/account/unblock.go2
-rw-r--r--internal/api/client/account/unfollow.go2
13 files changed, 13 insertions, 13 deletions
diff --git a/internal/api/client/account/accountcreate.go b/internal/api/client/account/accountcreate.go
index 50e72655e..a9d672f80 100644
--- a/internal/api/client/account/accountcreate.go
+++ b/internal/api/client/account/accountcreate.go
@@ -101,7 +101,7 @@ func (m *Module) AccountCreatePOSTHandler(c *gin.Context) {
form.IP = signUpIP
- ti, err := m.processor.AccountCreate(authed, form)
+ ti, err := m.processor.AccountCreate(c.Request.Context(), authed, form)
if err != nil {
l.Errorf("internal server error while creating new account: %s", err)
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
diff --git a/internal/api/client/account/accountget.go b/internal/api/client/account/accountget.go
index a7f9d8c70..8bac1360b 100644
--- a/internal/api/client/account/accountget.go
+++ b/internal/api/client/account/accountget.go
@@ -70,7 +70,7 @@ func (m *Module) AccountGETHandler(c *gin.Context) {
return
}
- acctInfo, err := m.processor.AccountGet(authed, targetAcctID)
+ acctInfo, err := m.processor.AccountGet(c.Request.Context(), authed, targetAcctID)
if err != nil {
c.JSON(http.StatusNotFound, gin.H{"error": "not found"})
return
diff --git a/internal/api/client/account/accountupdate.go b/internal/api/client/account/accountupdate.go
index f55f45f59..282d172ed 100644
--- a/internal/api/client/account/accountupdate.go
+++ b/internal/api/client/account/accountupdate.go
@@ -122,7 +122,7 @@ func (m *Module) AccountUpdateCredentialsPATCHHandler(c *gin.Context) {
return
}
- acctSensitive, err := m.processor.AccountUpdate(authed, form)
+ acctSensitive, err := m.processor.AccountUpdate(c.Request.Context(), authed, form)
if err != nil {
l.Debugf("could not update account: %s", err)
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
diff --git a/internal/api/client/account/accountupdate_test.go b/internal/api/client/account/accountupdate_test.go
index 349429625..8fc31171b 100644
--- a/internal/api/client/account/accountupdate_test.go
+++ b/internal/api/client/account/accountupdate_test.go
@@ -79,7 +79,7 @@ func (suite *AccountUpdateTestSuite) TestAccountUpdateCredentialsPATCHHandler()
recorder := httptest.NewRecorder()
ctx, _ := gin.CreateTestContext(recorder)
ctx.Set(oauth.SessionAuthorizedAccount, suite.testAccounts["local_account_1"])
- ctx.Set(oauth.SessionAuthorizedToken, oauth.TokenToOauthToken(suite.testTokens["local_account_1"]))
+ ctx.Set(oauth.SessionAuthorizedToken, oauth.DBTokenToToken(suite.testTokens["local_account_1"]))
ctx.Set(oauth.SessionAuthorizedApplication, suite.testApplications["application_1"])
ctx.Set(oauth.SessionAuthorizedUser, suite.testUsers["local_account_1"])
ctx.Request = httptest.NewRequest(http.MethodPatch, fmt.Sprintf("http://localhost:8080/%s", account.UpdateCredentialsPath), bytes.NewReader(requestBody.Bytes())) // the endpoint we're hitting
diff --git a/internal/api/client/account/accountverify.go b/internal/api/client/account/accountverify.go
index 4c77f3fa6..c5c40a03d 100644
--- a/internal/api/client/account/accountverify.go
+++ b/internal/api/client/account/accountverify.go
@@ -59,7 +59,7 @@ func (m *Module) AccountVerifyGETHandler(c *gin.Context) {
return
}
- acctSensitive, err := m.processor.AccountGet(authed, authed.Account.ID)
+ acctSensitive, err := m.processor.AccountGet(c.Request.Context(), authed, authed.Account.ID)
if err != nil {
l.Debugf("error getting account from processor: %s", err)
c.JSON(http.StatusInternalServerError, gin.H{"error": "internal server error"})
diff --git a/internal/api/client/account/block.go b/internal/api/client/account/block.go
index 0d9d6c51b..243f90c5e 100644
--- a/internal/api/client/account/block.go
+++ b/internal/api/client/account/block.go
@@ -72,7 +72,7 @@ func (m *Module) AccountBlockPOSTHandler(c *gin.Context) {
return
}
- relationship, errWithCode := m.processor.AccountBlockCreate(authed, targetAcctID)
+ relationship, errWithCode := m.processor.AccountBlockCreate(c.Request.Context(), authed, targetAcctID)
if errWithCode != nil {
c.JSON(errWithCode.Code(), gin.H{"error": errWithCode.Safe()})
return
diff --git a/internal/api/client/account/follow.go b/internal/api/client/account/follow.go
index 985a5f821..8f3f7ad0a 100644
--- a/internal/api/client/account/follow.go
+++ b/internal/api/client/account/follow.go
@@ -99,7 +99,7 @@ func (m *Module) AccountFollowPOSTHandler(c *gin.Context) {
}
form.ID = targetAcctID
- relationship, errWithCode := m.processor.AccountFollowCreate(authed, form)
+ relationship, errWithCode := m.processor.AccountFollowCreate(c.Request.Context(), authed, form)
if errWithCode != nil {
c.JSON(errWithCode.Code(), gin.H{"error": errWithCode.Safe()})
return
diff --git a/internal/api/client/account/followers.go b/internal/api/client/account/followers.go
index 7e93544b8..4f30e9939 100644
--- a/internal/api/client/account/followers.go
+++ b/internal/api/client/account/followers.go
@@ -74,7 +74,7 @@ func (m *Module) AccountFollowersGETHandler(c *gin.Context) {
return
}
- followers, errWithCode := m.processor.AccountFollowersGet(authed, targetAcctID)
+ followers, errWithCode := m.processor.AccountFollowersGet(c.Request.Context(), authed, targetAcctID)
if errWithCode != nil {
c.JSON(errWithCode.Code(), gin.H{"error": errWithCode.Safe()})
return
diff --git a/internal/api/client/account/following.go b/internal/api/client/account/following.go
index e70265eb5..baac2c9d3 100644
--- a/internal/api/client/account/following.go
+++ b/internal/api/client/account/following.go
@@ -74,7 +74,7 @@ func (m *Module) AccountFollowingGETHandler(c *gin.Context) {
return
}
- following, errWithCode := m.processor.AccountFollowingGet(authed, targetAcctID)
+ following, errWithCode := m.processor.AccountFollowingGet(c.Request.Context(), authed, targetAcctID)
if errWithCode != nil {
c.JSON(errWithCode.Code(), gin.H{"error": errWithCode.Safe()})
return
diff --git a/internal/api/client/account/relationships.go b/internal/api/client/account/relationships.go
index 9dbc8c4bb..d350209af 100644
--- a/internal/api/client/account/relationships.go
+++ b/internal/api/client/account/relationships.go
@@ -71,7 +71,7 @@ func (m *Module) AccountRelationshipsGETHandler(c *gin.Context) {
relationships := []model.Relationship{}
for _, targetAccountID := range targetAccountIDs {
- r, errWithCode := m.processor.AccountRelationshipGet(authed, targetAccountID)
+ r, errWithCode := m.processor.AccountRelationshipGet(c.Request.Context(), authed, targetAccountID)
if err != nil {
c.JSON(errWithCode.Code(), gin.H{"error": errWithCode.Safe()})
return
diff --git a/internal/api/client/account/statuses.go b/internal/api/client/account/statuses.go
index 097ccc3cc..4841d86df 100644
--- a/internal/api/client/account/statuses.go
+++ b/internal/api/client/account/statuses.go
@@ -166,7 +166,7 @@ func (m *Module) AccountStatusesGETHandler(c *gin.Context) {
mediaOnly = i
}
- statuses, errWithCode := m.processor.AccountStatusesGet(authed, targetAcctID, limit, excludeReplies, maxID, pinnedOnly, mediaOnly)
+ statuses, errWithCode := m.processor.AccountStatusesGet(c.Request.Context(), authed, targetAcctID, limit, excludeReplies, maxID, pinnedOnly, mediaOnly)
if errWithCode != nil {
l.Debugf("error from processor account statuses get: %s", errWithCode)
c.JSON(errWithCode.Code(), gin.H{"error": errWithCode.Safe()})
diff --git a/internal/api/client/account/unblock.go b/internal/api/client/account/unblock.go
index d9a2f2881..7b16ac887 100644
--- a/internal/api/client/account/unblock.go
+++ b/internal/api/client/account/unblock.go
@@ -72,7 +72,7 @@ func (m *Module) AccountUnblockPOSTHandler(c *gin.Context) {
return
}
- relationship, errWithCode := m.processor.AccountBlockRemove(authed, targetAcctID)
+ relationship, errWithCode := m.processor.AccountBlockRemove(c.Request.Context(), authed, targetAcctID)
if errWithCode != nil {
c.JSON(errWithCode.Code(), gin.H{"error": errWithCode.Safe()})
return
diff --git a/internal/api/client/account/unfollow.go b/internal/api/client/account/unfollow.go
index 84a558c65..7ac9697d5 100644
--- a/internal/api/client/account/unfollow.go
+++ b/internal/api/client/account/unfollow.go
@@ -75,7 +75,7 @@ func (m *Module) AccountUnfollowPOSTHandler(c *gin.Context) {
return
}
- relationship, errWithCode := m.processor.AccountFollowRemove(authed, targetAcctID)
+ relationship, errWithCode := m.processor.AccountFollowRemove(c.Request.Context(), authed, targetAcctID)
if errWithCode != nil {
l.Debug(errWithCode.Error())
c.JSON(errWithCode.Code(), gin.H{"error": errWithCode.Safe()})