projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix king tracking in Fusion variant
[vchess.git]
/
server
/
models
/
Variant.js
diff --git
a/server/models/Variant.js
b/server/models/Variant.js
index
233d938
..
d01d2a2
100644
(file)
--- a/
server/models/Variant.js
+++ b/
server/models/Variant.js
@@
-1,4
+1,4
@@
-
var
db = require("../utils/database");
+
const
db = require("../utils/database");
/*
* Structure:
/*
* Structure:
@@
-7,30
+7,19
@@
var db = require("../utils/database");
* description: varchar
*/
* description: varchar
*/
-const VariantModel =
-{
- getByName: function(name, callback)
- {
- db.serialize(function() {
- const query =
- "SELECT * " +
- "FROM Variants " +
- "WHERE name='" + name + "'";
- db.get(query, callback);
- });
- },
+const VariantModel = {
- getAll: function(callback)
- {
- db.serialize(function() {
- const query =
- "SELECT * " +
- "FROM Variants";
- db.all(query, callback);
- });
- },
+ getAll: function(callback) {
+ db.serialize(function() {
+ const query =
+ "SELECT * " +
+ "FROM Variants";
+ db.all(query, callback);
+ });
+ }
- //create, update, delete: directly in DB
-}
+ //create, update, delete: directly in DB
+
+};
module.exports = VariantModel;
module.exports = VariantModel;