2021-05-31 17:36:35 +02:00
|
|
|
package filter
|
|
|
|
|
2021-06-13 18:42:28 +02:00
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
2023-01-02 13:10:50 +01:00
|
|
|
apiutil "github.com/superseriousbusiness/gotosocial/internal/api/util"
|
2022-06-08 20:38:03 +02:00
|
|
|
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
|
|
|
|
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
2021-06-13 18:42:28 +02:00
|
|
|
)
|
2021-05-31 17:36:35 +02:00
|
|
|
|
|
|
|
// FiltersGETHandler returns a list of filters set by/for the authed account
|
|
|
|
func (m *Module) FiltersGETHandler(c *gin.Context) {
|
2022-06-08 20:38:03 +02:00
|
|
|
if _, err := oauth.Authed(c, true, true, true, true); err != nil {
|
2023-01-02 13:10:50 +01:00
|
|
|
apiutil.ErrorHandler(c, gtserror.NewErrorUnauthorized(err, err.Error()), m.processor.InstanceGet)
|
2022-06-08 20:38:03 +02:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2023-01-02 13:10:50 +01:00
|
|
|
if _, err := apiutil.NegotiateAccept(c, apiutil.JSONAcceptHeaders...); err != nil {
|
|
|
|
apiutil.ErrorHandler(c, gtserror.NewErrorNotAcceptable(err, err.Error()), m.processor.InstanceGet)
|
2021-12-11 17:50:00 +01:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-06-13 18:42:28 +02:00
|
|
|
c.JSON(http.StatusOK, []string{})
|
2021-05-31 17:36:35 +02:00
|
|
|
}
|