summaryrefslogtreecommitdiffstats
path: root/api4/params.go
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <ZJvandeWeg@users.noreply.github.com>2017-06-15 14:13:18 +0200
committerJoram Wilander <jwawilander@gmail.com>2017-06-15 08:13:18 -0400
commit0c04c5334fc89cf62a4bd3c1ce20469523a24026 (patch)
tree30b56cf82205ef5d739059ec1b3a24865e8d0fb3 /api4/params.go
parent98ac903fce24418538edbec77a218bcac9e20cd2 (diff)
downloadchat-0c04c5334fc89cf62a4bd3c1ce20469523a24026.tar.gz
chat-0c04c5334fc89cf62a4bd3c1ce20469523a24026.tar.bz2
chat-0c04c5334fc89cf62a4bd3c1ce20469523a24026.zip
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.
Diffstat (limited to 'api4/params.go')
-rw-r--r--api4/params.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/api4/params.go b/api4/params.go
index aa865fd2a..d952eb65a 100644
--- a/api4/params.go
+++ b/api4/params.go
@@ -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 {