import AmpCollection from "./apiPointer.js"
import usedCode from "./usedCode"

//this holds the requests for codes that the user
//has received

module.exports = AmpCollection.extend({

  model: usedCode,

  location: "usedCode-collection",

  initialize() {
    AmpCollection.prototype.initialize.call(this)
  }
})

@@ -1,13 +1,10 @@
-impor
+le
 t AmpCol
@@ -11,21 +11,26 @@
 lection 
-from 
+= require(
 %22./apiPo
@@ -42,14 +42,12 @@
 .js%22
-%0Aimpor
+)%0Ale
 t us
@@ -57,13 +57,18 @@
 ode 
-from 
+= require(
 %22./u
@@ -75,16 +75,17 @@
 sedCode%22
+)
 %0A%0A//this
@@ -148,102 +148,789 @@
 ed%0A%0A
-module.exports = AmpCollection.extend(%7B%0A%0A  model: usedCode,%0A%0A  location: %22usedCode-collection%22
+/*%0A%0A  %7B%0A    %22chatOrTicket%22: %22%22,%0A    %22customerEmail%22: %22%22,%0A    %22customerName%22: %22%22,%0A    %22productId%22: 0,%0A    %22representative%22: %22%22,%0A    %22universityOrBusiness%22: %22%22,%0A    %22code%22: %22%22,%0A    %22date%22: %22%22,%0A  %7D%0A%0A      filter: %7B%0A        where: query,%0A        limit: 50,%0A        order: %22date DESC%22%0A      %7D%0A*/%0A%0Amodule.exports = AmpCollection.extend(%7B%0A%0A  model: usedCode,%0A%0A  location: %22usedCode-collection%22,%0A%0A  byProduct(prodId) %7B%0A%0A    let query = %7B%0A      filter: %7B%0A        %22where%22: %7B%0A          %22productId%22: prodId%0A        %7D,%0A        limit: 50,%0A        order: %22date DESC%22%0A      %7D%0A    %7D%0A    return query%0A  %7D,%0A%0A  format (data) %7B%0A%0A    let query = %7B%0A      filter: %7B%0A        where: data.where,%0A        limit: data.limit,%0A        order: data.order%0A      %7D%0A    %7D%0A%0A    console.log(query)%0A%0A    return query%0A  %7D
 ,%0A%0A 

update usedCode-collection