functions/helpers: Add DB tests.

Signed-off-by: John Sahhar <john@gravitl.com>
This commit is contained in:
John Sahhar
2022-03-27 12:11:12 -06:00
parent f3599ba57f
commit e086cee9f2
2 changed files with 93 additions and 13 deletions

View File

@@ -71,16 +71,3 @@ func GetAllExtClients() ([]models.ExtClient, error) {
return extclients, nil
}
// DeleteKey - deletes a key
func DeleteKey(network models.Network, i int) {
network.AccessKeys = append(network.AccessKeys[:i],
network.AccessKeys[i+1:]...)
if networkData, err := json.Marshal(&network); err != nil {
return
} else {
database.Insert(network.NetID, string(networkData), database.NETWORKS_TABLE_NAME)
}
}