fix(assets): strip internal full_count column from list response
The window function COUNT(*) OVER() leaks `full_count` on every row. Strip it before sending so callers only see actual asset fields.
This commit is contained in:
parent
660afb94bb
commit
e6314be92d
1 changed files with 1 additions and 1 deletions
|
|
@ -82,7 +82,7 @@ router.get('/', async (req, res, next) => {
|
||||||
const total = result.rows.length > 0 ? parseInt(result.rows[0].full_count, 10) : 0;
|
const total = result.rows.length > 0 ? parseInt(result.rows[0].full_count, 10) : 0;
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
assets: result.rows,
|
assets: result.rows.map(({ full_count, ...rest }) => rest),
|
||||||
total,
|
total,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue