Skip to content

Commit

Permalink
fix: deal status filtering (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Shaw authored Nov 25, 2021
1 parent e52314e commit a7b4151
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = ({ body }) => {
{
dealId: 12345,
storageProvider: 'f99',
status: 'Active',
status: 'active',
pieceCid: 'baga',
dataCid: 'bafybeifnfkzjeohjf2dch2iqqpef3bfjylwxlcjws2msvdfyze5bvdprfm',
dataModelSelector: 'Links/0/Links',
Expand All @@ -20,7 +20,7 @@ module.exports = ({ body }) => {
{
dealId: 123456,
storageProvider: 'f98',
status: 'Terminated',
status: 'terminated',
pieceCid: 'baga',
dataCid: 'bafybeifnfkzjeohjf2dch2iqqpef3bfjylwxlcjws2msvdfyze5bvdprfm',
dataModelSelector: 'Links/0/Links',
Expand All @@ -31,7 +31,7 @@ module.exports = ({ body }) => {
]
} else if (body.cids.includes('bafybeica6klnrhlrbx6z24icefykpbwyypouglnypvnwb5esdm6yzcie3q')) {
return [{
status: 'Queued',
status: 'queued',
pieceCid: 'baga',
dataCid: 'bafybeica6klnrhlrbx6z24icefykpbwyypouglnypvnwb5esdm6yzcie3q',
dataModelSelector: 'Links/0/Links'
Expand Down
8 changes: 4 additions & 4 deletions packages/db/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function normalizeDeals (deals) {
.map(deal => ({
dealId: deal.dealId,
storageProvider: deal.storageProvider,
status: deal.status,
status: deal.status[0].toUpperCase() + deal.status.slice(1),
pieceCid: deal.pieceCid,
dataCid: deal.dataCid,
dataModelSelector: deal.dataModelSelector,
Expand All @@ -73,7 +73,7 @@ const PIN_STATUS = new Set([
])

const DEAL_STATUS = new Set([
'Queued',
'Published',
'Active'
'queued',
'published',
'active'
])

0 comments on commit a7b4151

Please sign in to comment.