0xdcarns %!s(int64=3) %!d(string=hai) anos
pai
achega
c748594c02
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      database/database.go

+ 2 - 1
database/database.go

@@ -139,7 +139,8 @@ func createTable(tableName string) error {
 // IsJSONString - checks if valid json
 func IsJSONString(value string) bool {
 	var jsonInt interface{}
-	return json.Unmarshal([]byte(value), &jsonInt) == nil
+	var nodeInt models.Node
+	return json.Unmarshal([]byte(value), &jsonInt) == nil || json.Unmarshal([]byte(value), &nodeInt) == nil
 }
 
 // Insert - inserts object into db