Skip to content

Conversation

@tesaide
Copy link
Contributor

@tesaide tesaide commented Dec 8, 2025

No description provided.

unlistedPrice: item.unlistedPrice.toFixed(2),
})
);
const arr = data.value?.listedVsUnlistedPriceByDays;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this fix lets simply return data in correct order from backend , by modifying query (this is live demo so this is crucial to keep code simple)

LIMIT ?;
`
).all(days);
apartsByDays.reverse();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tesaide lets just fix SQL (asc desc?)

COUNT(*) as count
FROM apartments
GROUP BY day
ORDER BY day DESC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tesaide please change it here

const days = req.body.days || 7;
const apartsByDays = await db.prepare(
`SELECT
`SELECT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tesaide please return whitespaces back

Correct formatting:

const x = function doThis(
  aa=1,
  bb=2
)

Bad formatting

const x = function doThis(
aa=1,  // reads really hard, it is hard to distinguish
  bb=2
)

ORDER BY day ASC
LIMIT ?;`
).all(days);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tesaide I think there is no sense to add a new empty line?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants