mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
24 lines
476 B
Go
24 lines
476 B
Go
package databag
|
|
|
|
import (
|
|
"errors"
|
|
"net/http"
|
|
"gorm.io/gorm"
|
|
"databag/internal/store"
|
|
)
|
|
|
|
func GetNodeStatus(w http.ResponseWriter, r *http.Request) {
|
|
var config store.Config
|
|
err := store.DB.Where("config_id = ?", CONFIG_CONFIGURED).First(&config).Error
|
|
if err != nil {
|
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
|
WriteResponse(w, true)
|
|
} else {
|
|
w.WriteHeader(http.StatusInternalServerError);
|
|
}
|
|
return
|
|
}
|
|
WriteResponse(w, false);
|
|
}
|
|
|