From f23f04e0b1d117be714bf91d5266dab219ed741e Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sat, 24 Aug 2024 11:49:37 +0200 Subject: [feature] Interaction requests client api + settings panel (#3215) * [feature] Interaction requests client api + settings panel * test accept / reject * fmt * don't pin rejected interaction * use single db model for interaction accept, reject, and request * swaggor * env sharting * append errors * remove ErrNoEntries checks * change intReqID to reqID * rename "pend" to "request" * markIntsPending -> mark interactionsPending * use log instead of returning error when rejecting interaction * empty migration * jolly renaming * make interactionURI unique again * swag grr * remove unnecessary locks * invalidate as last step --- internal/typeutils/internaltoas_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'internal/typeutils/internaltoas_test.go') diff --git a/internal/typeutils/internaltoas_test.go b/internal/typeutils/internaltoas_test.go index 905dccfad..50719c0b4 100644 --- a/internal/typeutils/internaltoas_test.go +++ b/internal/typeutils/internaltoas_test.go @@ -1057,26 +1057,26 @@ func (suite *InternalToASTestSuite) TestPollVoteToASCreate() { }`, string(bytes)) } -func (suite *InternalToASTestSuite) TestInteractionApprovalToASAccept() { +func (suite *InternalToASTestSuite) TestInteractionReqToASAccept() { acceptingAccount := suite.testAccounts["local_account_1"] interactingAccount := suite.testAccounts["remote_account_1"] - interactionApproval := >smodel.InteractionApproval{ + req := >smodel.InteractionRequest{ ID: "01J1AKMZ8JE5NW0ZSFTRC1JJNE", CreatedAt: testrig.TimeMustParse("2022-06-09T13:12:00Z"), - UpdatedAt: testrig.TimeMustParse("2022-06-09T13:12:00Z"), - AccountID: acceptingAccount.ID, - Account: acceptingAccount, + TargetAccountID: acceptingAccount.ID, + TargetAccount: acceptingAccount, InteractingAccountID: interactingAccount.ID, InteractingAccount: interactingAccount, InteractionURI: "https://fossbros-anonymous.io/users/foss_satan/statuses/01J1AKRRHQ6MDDQHV0TP716T2K", InteractionType: gtsmodel.InteractionAnnounce, URI: "http://localhost:8080/users/the_mighty_zork/accepts/01J1AKMZ8JE5NW0ZSFTRC1JJNE", + AcceptedAt: testrig.TimeMustParse("2022-06-09T13:12:00Z"), } - accept, err := suite.typeconverter.InteractionApprovalToASAccept( + accept, err := suite.typeconverter.InteractionReqToASAccept( context.Background(), - interactionApproval, + req, ) if err != nil { suite.FailNow(err.Error()) -- cgit v1.2.3