fixed region fetching in user_attributes
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
package helper
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func RespondWithError(w http.ResponseWriter, statusCode int, message string) {
|
||||
w.Header().Set(ContentTypeHeader, ApplicationJSON)
|
||||
w.WriteHeader(statusCode)
|
||||
if encodeErr := json.NewEncoder(w).Encode(map[string]string{ErrorLabel: message}); encodeErr != nil {
|
||||
LogError(encodeErr, ErrorEncodingResponse)
|
||||
}
|
||||
}
|
||||
|
||||
func RespondWithMessage(w http.ResponseWriter, message string) {
|
||||
if encodeErr := json.NewEncoder(w).Encode(map[string]string{MessageLabel: message}); encodeErr != nil {
|
||||
LogError(encodeErr, ErrorEncodingResponse)
|
||||
}
|
||||
}
|
||||
|
||||
func RespondWithJSON(w http.ResponseWriter, statusCode int, data interface{}) {
|
||||
w.Header().Set(ContentTypeHeader, ApplicationJSON)
|
||||
w.WriteHeader(statusCode)
|
||||
if encodeErr := json.NewEncoder(w).Encode(data); encodeErr != nil {
|
||||
LogError(encodeErr, ErrorEncodingResponse)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user