Don't show questions for preview surveys
This commit is contained in:
parent
0a79763f69
commit
80776bb7a1
4 changed files with 16 additions and 2 deletions
|
@ -13,7 +13,9 @@ import (
|
|||
func init() {
|
||||
router.GET("/api/surveys", apiAuthHandler(
|
||||
func(u *User, _ httprouter.Params, _ []byte) HTTPResponse {
|
||||
if u != nil && u.IsAdmin {
|
||||
if u == nil {
|
||||
return formatApiResponse(getSurveys("WHERE shown = TRUE AND NOW() > start_availability"))
|
||||
} else if u.IsAdmin {
|
||||
return formatApiResponse(getSurveys(""))
|
||||
} else {
|
||||
return formatApiResponse(getSurveys("WHERE shown = TRUE"))
|
||||
|
|
Reference in a new issue