|
12345678910111213141516171819202122 |
- package endpoints
-
- import (
- "encoding/json"
- "net/http"
-
- . "github.com/imosed/signet/data"
- "github.com/rs/zerolog/log"
- )
-
- func UsersExist(w http.ResponseWriter, _ *http.Request) {
- var numUsers int64
- Db.Table("users").Count(&numUsers)
-
- var resp SuccessResponse
- resp.Success = numUsers > 0
-
- err := json.NewEncoder(w).Encode(resp)
- if err != nil {
- log.Error().Err(err).Msg("Could not deliver response in UsersExist call")
- }
- }
|