fixed client side for multinet and added group filter to query params server side.

This commit is contained in:
afeiszli
2021-04-05 11:06:30 -04:00
parent 0080e9a2ee
commit 1f377997cb
9 changed files with 229 additions and 127 deletions

View File

@@ -408,7 +408,7 @@ func checkIn(w http.ResponseWriter, r *http.Request) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
filter := bson.M{"macaddress": params["macaddress"]}
filter := bson.M{"macaddress": params["macaddress"], "group": params["group"]}
//old code was inefficient, this is all we need.
time := time.Now().String()
@@ -570,7 +570,7 @@ func uncordonNode(w http.ResponseWriter, r *http.Request) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
// Create filter
filter := bson.M{"macaddress": params["macaddress"]}
filter := bson.M{"macaddress": params["macaddress"], "group": params["group"]}
node.SetLastModified()