2021-05-31 17:36:35 +02:00
|
|
|
package list
|
|
|
|
|
2021-06-13 18:42:28 +02:00
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
2021-12-11 17:50:00 +01:00
|
|
|
"github.com/superseriousbusiness/gotosocial/internal/api"
|
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
|
|
|
|
|
|
|
// ListsGETHandler returns a list of lists created by/for the authed account
|
|
|
|
func (m *Module) ListsGETHandler(c *gin.Context) {
|
2022-06-08 20:38:03 +02:00
|
|
|
if _, err := oauth.Authed(c, true, true, true, true); err != nil {
|
|
|
|
api.ErrorHandler(c, gtserror.NewErrorUnauthorized(err, err.Error()), m.processor.InstanceGet)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-12-11 17:50:00 +01:00
|
|
|
if _, err := api.NegotiateAccept(c, api.JSONAcceptHeaders...); err != nil {
|
2022-06-08 20:38:03 +02:00
|
|
|
api.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
|
|
|
}
|