This repository has been archived by the owner on Sep 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding summary model and starting to add logic, refs #7
- Loading branch information
Genar Trias Ortiz
committed
Dec 5, 2017
1 parent
9ab57d9
commit a7b87e5
Showing
5 changed files
with
107 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,5 +37,9 @@ | |
"order": { | ||
"dataSource": null, | ||
"public": true | ||
}, | ||
"summary": { | ||
"dataSource": null, | ||
"public": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import BittrexExchange from '../exchanges/bittrex' | ||
|
||
module.exports = function (Summary) { | ||
Summary.getSummarys = (cb) => { | ||
const bitrexOpts = Summary.app.get('bittrex') | ||
const exchange = new BittrexExchange(bitrexOpts) | ||
|
||
exchange.getSummary((err, data) => { | ||
if (err) { | ||
cb(err) | ||
} | ||
|
||
cb(null, data) | ||
}) | ||
} | ||
|
||
Summary.remoteMethod('getSummarys', { | ||
http: { verb: 'get', path: '/' }, | ||
returns: {type: 'array', root: true} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "summary", | ||
"plural": "summaries", | ||
"base": "Model", | ||
"idInjection": true, | ||
"options": { | ||
"validateUpsert": true | ||
}, | ||
"properties": {}, | ||
"validations": [], | ||
"relations": {}, | ||
"acls": [], | ||
"methods": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters