Add APIv4 endpoint to permanently delete teams (#6604)

Tests are added, however, it only tests the property if its soft deleted. In the
background it will be hard deleted, but that is untestable through a integration
test.
Этот коммит содержится в:
Zeger-Jan van de Weg
2017-06-15 14:13:18 +02:00
коммит произвёл Joram Wilander
родитель 98ac903fce
Коммит 0c04c5334f
5 изменённых файлов: 67 добавлений и 3 удалений

Просмотреть файл

@@ -39,6 +39,7 @@ type ApiParams struct {
JobType string
Page int
PerPage int
Permanent bool
}
func ApiParamsFromRequest(r *http.Request) *ApiParams {
@@ -132,6 +133,10 @@ func ApiParamsFromRequest(r *http.Request) *ApiParams {
params.Page = val
}
if val, err := strconv.ParseBool(r.URL.Query().Get("permanent")); err != nil {
params.Permanent = val
}
if val, err := strconv.Atoi(r.URL.Query().Get("per_page")); err != nil || val < 0 {
params.PerPage = PER_PAGE_DEFAULT
} else if val > PER_PAGE_MAXIMUM {