mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-10-19 16:55:29 +02:00
382512a5a6
* interim: start adding /api/v2/instance * finish up
26 lines
817 B
Go
26 lines
817 B
Go
package filter
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
apiutil "github.com/superseriousbusiness/gotosocial/internal/api/util"
|
|
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
|
|
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
|
)
|
|
|
|
// FiltersGETHandler returns a list of filters set by/for the authed account
|
|
func (m *Module) FiltersGETHandler(c *gin.Context) {
|
|
if _, err := oauth.Authed(c, true, true, true, true); err != nil {
|
|
apiutil.ErrorHandler(c, gtserror.NewErrorUnauthorized(err, err.Error()), m.processor.InstanceGetV1)
|
|
return
|
|
}
|
|
|
|
if _, err := apiutil.NegotiateAccept(c, apiutil.JSONAcceptHeaders...); err != nil {
|
|
apiutil.ErrorHandler(c, gtserror.NewErrorNotAcceptable(err, err.Error()), m.processor.InstanceGetV1)
|
|
return
|
|
}
|
|
|
|
c.JSON(http.StatusOK, []string{})
|
|
}
|