mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[bugfix] Filter fixes (#2971)
* Add Filter.Expired convenience method, consistent with mutes * Add missing Swagger for filter keyword/status delete and for 403s on moved accounts
This commit is contained in:
@@ -117,6 +117,8 @@ import (
|
||||
// description: bad request
|
||||
// '401':
|
||||
// description: unauthorized
|
||||
// '403':
|
||||
// description: forbidden to moved accounts
|
||||
// '404':
|
||||
// description: not found
|
||||
// '406':
|
||||
|
@@ -123,6 +123,8 @@ import (
|
||||
// description: bad request
|
||||
// '401':
|
||||
// description: unauthorized
|
||||
// '403':
|
||||
// description: forbidden to moved accounts
|
||||
// '404':
|
||||
// description: not found
|
||||
// '406':
|
||||
|
@@ -26,6 +26,42 @@ import (
|
||||
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
||||
)
|
||||
|
||||
// FilterKeywordDELETEHandler swagger:operation DELETE /api/v2/filters/keywords/{id} filterKeywordDelete
|
||||
//
|
||||
// Delete a single filter keyword with the given ID.
|
||||
//
|
||||
// ---
|
||||
// tags:
|
||||
// - filters
|
||||
//
|
||||
// produces:
|
||||
// - application/json
|
||||
//
|
||||
// parameters:
|
||||
// -
|
||||
// name: id
|
||||
// type: string
|
||||
// description: ID of the filter keyword
|
||||
// in: path
|
||||
// required: true
|
||||
//
|
||||
// security:
|
||||
// - OAuth2 Bearer:
|
||||
// - write:filters
|
||||
//
|
||||
// responses:
|
||||
// '200':
|
||||
// description: filter keyword deleted
|
||||
// '400':
|
||||
// description: bad request
|
||||
// '401':
|
||||
// description: unauthorized
|
||||
// '404':
|
||||
// description: not found
|
||||
// '406':
|
||||
// description: not acceptable
|
||||
// '500':
|
||||
// description: internal server error
|
||||
func (m *Module) FilterKeywordDELETEHandler(c *gin.Context) {
|
||||
authed, err := oauth.Authed(c, true, true, true, true)
|
||||
if err != nil {
|
||||
|
@@ -87,6 +87,8 @@ import (
|
||||
// description: bad request
|
||||
// '401':
|
||||
// description: unauthorized
|
||||
// '403':
|
||||
// description: forbidden to moved accounts
|
||||
// '404':
|
||||
// description: not found
|
||||
// '406':
|
||||
|
@@ -84,6 +84,8 @@ import (
|
||||
// description: bad request
|
||||
// '401':
|
||||
// description: unauthorized
|
||||
// '403':
|
||||
// description: forbidden to moved accounts
|
||||
// '404':
|
||||
// description: not found
|
||||
// '406':
|
||||
|
@@ -115,6 +115,8 @@ import (
|
||||
// description: bad request
|
||||
// '401':
|
||||
// description: unauthorized
|
||||
// '403':
|
||||
// description: forbidden to moved accounts
|
||||
// '404':
|
||||
// description: not found
|
||||
// '406':
|
||||
|
@@ -111,6 +111,8 @@ import (
|
||||
// description: bad request
|
||||
// '401':
|
||||
// description: unauthorized
|
||||
// '403':
|
||||
// description: forbidden to moved accounts
|
||||
// '404':
|
||||
// description: not found
|
||||
// '406':
|
||||
|
@@ -26,6 +26,42 @@ import (
|
||||
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
||||
)
|
||||
|
||||
// FilterStatusDELETEHandler swagger:operation DELETE /api/v2/filters/statuses/{id} filterStatusDelete
|
||||
//
|
||||
// Delete a single filter status with the given ID.
|
||||
//
|
||||
// ---
|
||||
// tags:
|
||||
// - filters
|
||||
//
|
||||
// produces:
|
||||
// - application/json
|
||||
//
|
||||
// parameters:
|
||||
// -
|
||||
// name: id
|
||||
// type: string
|
||||
// description: ID of the filter status
|
||||
// in: path
|
||||
// required: true
|
||||
//
|
||||
// security:
|
||||
// - OAuth2 Bearer:
|
||||
// - write:filters
|
||||
//
|
||||
// responses:
|
||||
// '200':
|
||||
// description: filter status deleted
|
||||
// '400':
|
||||
// description: bad request
|
||||
// '401':
|
||||
// description: unauthorized
|
||||
// '404':
|
||||
// description: not found
|
||||
// '406':
|
||||
// description: not acceptable
|
||||
// '500':
|
||||
// description: internal server error
|
||||
func (m *Module) FilterStatusDELETEHandler(c *gin.Context) {
|
||||
authed, err := oauth.Authed(c, true, true, true, true)
|
||||
if err != nil {
|
||||
|
@@ -75,6 +75,8 @@ import (
|
||||
// description: bad request
|
||||
// '401':
|
||||
// description: unauthorized
|
||||
// '403':
|
||||
// description: forbidden to moved accounts
|
||||
// '404':
|
||||
// description: not found
|
||||
// '406':
|
||||
|
Reference in New Issue
Block a user