Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions Needed For Frontend #1

Open
KunalSinha7 opened this issue Apr 19, 2018 · 3 comments
Open

Functions Needed For Frontend #1

KunalSinha7 opened this issue Apr 19, 2018 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@KunalSinha7
Copy link
Collaborator

KunalSinha7 commented Apr 19, 2018

Please make a verifyJWT route, so I can logout people when it expires/doesn't

@KunalSinha7 KunalSinha7 added the enhancement New feature or request label Apr 19, 2018
@KunalSinha7
Copy link
Collaborator Author

KunalSinha7 commented Apr 19, 2018

Also need GET-ALL-CURRENCIES and GET-USER-CURRENCIES, where GET-ALL-CURRENCIES returns all possible currencies in an array response: {currencies: [a,b,c]} and GET-USER-CURRENCIES returns all currencies a user owns and the amount they have response: {a: "200", b: "1", c: "2"}

@darwinfv
Copy link
Owner

SQL by default returns an array of JSONs. Hence, in most cases I pass on to the server an array with 1 element which is a JSON of the required information. As a result:

GET-USER-CURRENCIES = getUser(email) will return this:
[ RowDataPacket { usd: 950, eur: 30, inr: 70, brl: 500 } ]
Note the currencies are stored as floats.

I can change it to be RowDataPacket { usd: 950, eur: 30, inr: 70, brl: 500 } in 1 line so let me know.

You can either hardcode GET-ALL-CURRENCIES because there are exactly 25 currencies and that will never change OR you can call this amazing function which gives you some cool info.
latestValue()

{ eur:
   RowDataPacket {
     number: 8,
     total: 300000000,
     funds: 300000000,
     value: 1,
     diff: 0,
     percent: 0 },
  jpy:
   RowDataPacket {
     number: 1,
     total: 300000000,
     funds: 300000000,
     value: 1,
     diff: 0,
     percent: 0 },
  gbp:
   RowDataPacket {
     number: 1,
     total: 300000000,
     funds: 300000000,
     value: 1,
     diff: 0,
     percent: 0 },
  aud:
   RowDataPacket {
     number: 1,
     total: 300000000,
     funds: 300000000,
     value: 1,
     diff: 0,
     percent: 0 },

@Hiten98
Copy link
Collaborator

Hiten98 commented Apr 25, 2018

can I uhh... can I uhh... can I close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants