mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2026-01-06 14:33:17 -06:00
[feature] Implement /api/v1/reports endpoints on client API (#1330)
* start adding report client api * route + test reports get * start report create endpoint * you can create reports now babyy * stub account report processor * add single reportGet endpoint * fix test * add more filtering params to /api/v1/reports GET * update swagger * use marshalIndent in tests * add + test missing Link info
This commit is contained in:
parent
605dfca1af
commit
e9747247d5
26 changed files with 2184 additions and 20 deletions
|
|
@ -60,6 +60,22 @@ func (suite *ReportTestSuite) TestGetReportByURI() {
|
|||
suite.NotEmpty(report.URI)
|
||||
}
|
||||
|
||||
func (suite *ReportTestSuite) TestGetAllReports() {
|
||||
reports, err := suite.db.GetReports(context.Background(), nil, "", "", "", "", "", 0)
|
||||
suite.NoError(err)
|
||||
suite.NotEmpty(reports)
|
||||
}
|
||||
|
||||
func (suite *ReportTestSuite) TestGetAllReportsByAccountID() {
|
||||
accountID := suite.testAccounts["local_account_2"].ID
|
||||
reports, err := suite.db.GetReports(context.Background(), nil, accountID, "", "", "", "", 0)
|
||||
suite.NoError(err)
|
||||
suite.NotEmpty(reports)
|
||||
for _, r := range reports {
|
||||
suite.Equal(accountID, r.AccountID)
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *ReportTestSuite) TestPutReport() {
|
||||
ctx := context.Background()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue