mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature] Implement Filter API v2 (#2936)
* Use correct entity name * We support server-side filters now * Document filter v1 methods that can throw a 409 * Validate v1 filter phrase as filter title * Always check v1 filter API status codes in tests * Document keyword minimum requirement on filter API v1 * Make it possible to specify filter keyword update columns per filter keyword * Implement v2 filter API * Fix lint and tests * Update Swagger spec * Fix filter update test * Update Swagger spec *correctly* * Update actual files Swagger spec was generated from * Remove keywords_attributes and statuses_attributes * Add test for serialization of empty filter * More helpful messages when object is owned by wrong account
This commit is contained in:
@@ -47,3 +47,13 @@ func APIMarkerNameToMarkerName(m apimodel.MarkerName) gtsmodel.MarkerName {
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func APIFilterActionToFilterAction(m apimodel.FilterAction) gtsmodel.FilterAction {
|
||||
switch m {
|
||||
case apimodel.FilterActionWarn:
|
||||
return gtsmodel.FilterActionWarn
|
||||
case apimodel.FilterActionHide:
|
||||
return gtsmodel.FilterActionHide
|
||||
}
|
||||
return gtsmodel.FilterActionNone
|
||||
}
|
||||
|
Reference in New Issue
Block a user