implement choices_cost
This commit is contained in:
parent
f9abdd23c6
commit
476f0f553c
18 changed files with 180 additions and 24 deletions
19
frontend/choices.go
Normal file
19
frontend/choices.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"path"
|
||||
"time"
|
||||
)
|
||||
|
||||
func WantChoicesHandler(w http.ResponseWriter, r *http.Request, team string, sURL []string) {
|
||||
if time.Now().Sub(challengeEnd) > 0 {
|
||||
http.Error(w, "{\"errmsg\":\"Le challenge est terminé, trop tard !\"}", http.StatusGone)
|
||||
return
|
||||
}
|
||||
|
||||
// Enqueue file for backend treatment
|
||||
if saveTeamFile(path.Join(team, "choices"), w, r) {
|
||||
http.Error(w, "{\"errmsg\":\"Demande de choix acceptée...\"}", http.StatusAccepted)
|
||||
}
|
||||
}
|
Reference in a new issue