@outlawdesigns/armorysdk 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,7 @@ class AmmoPurchase extends Record{
15
15
  constructor(id){
16
16
  super(AmmoPurchase.database,AmmoPurchase.table,AmmoPurchase.primaryKey,id);
17
17
  this.publicKeys = [
18
- 'Id','Ammunition','Vendor','Rounds','Price','DatePurchased','DateReceived','User'
18
+ 'Id','AmmunitionType','Vendor','Rounds','Price','DatePurchased','DateReceived','User'
19
19
  ];
20
20
  }
21
21
  static async new(ammoId,vendorId,rounds,price,datePurchased,dateReceived,user){
@@ -62,7 +62,7 @@ class AmmoPurchase extends Record{
62
62
  static async getAwaitingReceipt(user){
63
63
  let records = [];
64
64
  let purchase = new AmmoPurchase();
65
- let ids = await purchase.db.table(purchase.table).select(purchase.primaryKey).where('DateReceived is null').andWhere('User = ' + user).execute();
65
+ let ids = await purchase.db.table(purchase.table).select(purchase.primaryKey).where('DateReceived is null').andWhere('User = ?', [user]).execute();
66
66
  for(let id in ids){
67
67
  let obj = await new AmmoPurchase(ids[id][purchase.primaryKey]).init();
68
68
  records.push(obj.getPublicProperties());
@@ -19,7 +19,7 @@ class FirearmImage extends Record{
19
19
  static async getByFirearmId(firearmId){
20
20
  let records = [];
21
21
  let model = new FirearmImage();
22
- let ids = await model.db.table(model.table).select(model.primaryKey).where('Firearm = ' + firearmId).execute();
22
+ let ids = await model.db.table(model.table).select(model.primaryKey).where('Firearm = ?', [firearmId]).execute();
23
23
  for(let id in ids){
24
24
  let obj = await new FirearmImage(ids[id][model.primaryKey]).init();
25
25
  records.push(obj.getPublicProperties());
@@ -19,7 +19,7 @@ class TargetImage extends Record{
19
19
  static async getByShootId(shootId){
20
20
  let records = [];
21
21
  let model = new TargetImage();
22
- let ids = await model.db.table(model.table).select(model.primaryKey).where('ShootId = ' + shootId).execute();
22
+ let ids = await model.db.table(model.table).select(model.primaryKey).where('ShootId = ?', [shootId]).execute();
23
23
  for(let id in ids){
24
24
  let obj = await new TargetImage(ids[id][model.primaryKey]).init();
25
25
  records.push(obj.getPublicProperties());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@outlawdesigns/armorysdk",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"