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

added "created" field in query #75

Merged
merged 2 commits into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion app/models/quote.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,21 @@ Quote.getHistory = (userAddress, offset, limit) => {
console.log('Max pages:', maxPages)

const query = `
SELECT 'arweave' AS 'type', quote.quoteId, quote.userAddress, quote.status, quote.chainId, quote.tokenAddress, quote.tokenAmount, quote.approveAddress, files.transactionHash
SELECT
'arweave' AS 'type',
quote.quoteId,
quote.created,
quote.userAddress,
quote.status,
quote.chainId,
quote.tokenAddress,
quote.tokenAmount,
quote.approveAddress,
files.transactionHash
FROM quote
INNER JOIN files ON quote.quoteId = files.quoteId
WHERE quote.userAddress = ? AND quote.status != 1
ORDER BY quote.created DESC
LIMIT ${integerLimit} OFFSET ${integerOffset};
`

Expand Down
Loading