The backend for the project formerly known as signet, now known as beignet.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 1 gada
pirms 1 gada
12345678910111213141516171819202122
  1. package endpoints
  2. import (
  3. "encoding/json"
  4. "net/http"
  5. . "github.com/imosed/signet/data"
  6. "github.com/rs/zerolog/log"
  7. )
  8. func UsersExist(w http.ResponseWriter, _ *http.Request) {
  9. var numUsers int64
  10. Db.Table("users").Count(&numUsers)
  11. var resp SuccessResponse
  12. resp.Success = numUsers > 0
  13. err := json.NewEncoder(w).Encode(resp)
  14. if err != nil {
  15. log.Error().Err(err).Msg("Could not deliver response in UsersExist call")
  16. }
  17. }