diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2023-09-25 23:00:57 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2023-09-25 23:00:57 +0200 |
commit | 982bd8a43c50bb5845b694dbd0b3e0ffbf43dad7 (patch) | |
tree | a0b711018858b8daf918c9f066562a6f9afc04f8 /garage.go | |
parent | 08287375736a0a57c03b4bd6d9c222dc5567db6e (diff) | |
download | guichet-982bd8a43c50bb5845b694dbd0b3e0ffbf43dad7.tar.gz guichet-982bd8a43c50bb5845b694dbd0b3e0ffbf43dad7.zip |
done with APIapi
Diffstat (limited to 'garage.go')
-rw-r--r-- | garage.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -194,9 +194,9 @@ func handleWebsiteList(w http.ResponseWriter, r *http.Request) { return } - list := ctrl.List() - if len(list) > 0 { - http.Redirect(w, r, "/website/inspect/"+list[0].Pretty, http.StatusFound) + desc := ctrl.Describe() + if len(desc.Websites) > 0 { + http.Redirect(w, r, "/website/inspect/"+desc.Websites[0].Pretty, http.StatusFound) } else { http.Redirect(w, r, "/website/new", http.StatusFound) } @@ -271,7 +271,7 @@ func handleWebsiteInspect(w http.ResponseWriter, r *http.Request) { action := strings.Join(r.Form["action"],"") switch action { case "increase_quota": - _, processErr = ctrl.Patch(bucketName, &WebsitePatch { size: &user.Quota.WebsiteSizeBursted }) + _, processErr = ctrl.Patch(bucketName, &WebsitePatch { Size: &user.Quota.WebsiteSizeBursted }) case "delete_bucket": processErr = ctrl.Delete(bucketName) http.Redirect(w, r, "/website", http.StatusFound) |