oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1package equipo
2
3import (
4 "context"
5 "net/http"
6 "strconv"
7
8 "amadan.net/oficina/equipo/internal/equipo/chat"
9)
10
11func (a *application) saveAutonomySetting(w http.ResponseWriter, r *http.Request) {
12 a.chatActionTo(w, r, "/conversation/settings/autonomy", func(ctx context.Context, person string) error {
13 revision, err := strconv.ParseInt(r.FormValue("revision"), 10, 64)
14 if err != nil || revision < 0 {
15 return chat.ErrInvalid
16 }
17 return a.store.Chat().SetProjectAutonomy(ctx, person, r.FormValue("project"), r.FormValue("auto_merge_ci") == "on", r.FormValue("public_previews") == "on", revision, r.FormValue("auto_merge_sensitive") == "on")
18 })
19}
20