Skip to content

Commit

Permalink
fix query routes
Browse files Browse the repository at this point in the history
  • Loading branch information
MyMediaMagnet committed Mar 23, 2018
1 parent 7fc2652 commit 134ed53
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions dist/models/Query.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ var Query = function () {

}, {
key: 'get',
value: function get(id, callback) {
value: function get(id) {
var _this2 = this;

return new Promise(function (resolve, reject) {
return _axios2.default.post(_this2.getFullPath() + 'get', params).then(function (_ref2) {
return _axios2.default.post(_this2.getFullPath() + 'get', { id: id }).then(function (_ref2) {
var data = _ref2.data;

resolve(new _this2(data));
Expand All @@ -110,7 +110,7 @@ var Query = function () {
var _this3 = this;

return new Promise(function (resolve, reject) {
return _axios2.default.post(_this3.getFullPath() + 'get', params).then(function (_ref3) {
return _axios2.default.post(_this3.getFullPath() + 'create', data).then(function (_ref3) {
var data = _ref3.data;

resolve(new _this3(data));
Expand All @@ -128,7 +128,7 @@ var Query = function () {
var _this4 = this;

return new Promise(function (resolve, reject) {
return _axios2.default.post(_this4.getFullPath() + 'get', params).then(function (_ref4) {
return _axios2.default.post(_this4.getFullPath() + 'update', data).then(function (_ref4) {
var data = _ref4.data;

resolve(new _this4(data));
Expand Down
8 changes: 4 additions & 4 deletions src/models/Query.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ class Query {
}

// Get a particular item from the api
static get(id, callback) {
static get(id) {
return new Promise((resolve, reject) => {
return axios.post(this.getFullPath() + 'get', params).then(({data}) => {
return axios.post(this.getFullPath() + 'get', {id: id}).then(({data}) => {
resolve(new this(data))
}).catch((e) => {
reject(e)
Expand All @@ -61,7 +61,7 @@ class Query {
// Create an item of this model type
static create(data, callback) {
return new Promise((resolve, reject) => {
return axios.post(this.getFullPath() + 'get', params).then(({data}) => {
return axios.post(this.getFullPath() + 'create', data).then(({data}) => {
resolve(new this(data))
}).catch((e) => {
reject(e)
Expand All @@ -72,7 +72,7 @@ class Query {
// Update this item containing the primary key
static update(data, callback) {
return new Promise((resolve, reject) => {
return axios.post(this.getFullPath() + 'get', params).then(({data}) => {
return axios.post(this.getFullPath() + 'update', data).then(({data}) => {
resolve(new this(data))
}).catch((e) => {
reject(e)
Expand Down

0 comments on commit 134ed53

Please sign in to comment.