Fixed pagination not updating with async requests.

This commit is contained in:
2024-03-19 01:40:56 +01:00
parent 0bd4990b37
commit ab13ace280
6 changed files with 60 additions and 49 deletions

View File

@@ -498,7 +498,7 @@ async function queryManticoreSql(filters, options, _reqUser) {
?.data.map((row) => ({ key: row.channel_id || row['scenes.channel_id'], doc_count: row['count(*)'] }))
|| [];
const total = results.at(-1).data.find((entry) => entry.Variable_name === 'total_found').Value;
const total = Number(results.at(-1).data.find((entry) => entry.Variable_name === 'total_found').Value);
return {
scenes: results[0].data,

View File

@@ -1,16 +1,3 @@
// This file isn't processed by Vite, see https://github.com/vikejs/vike/issues/562
// Consequently:
// - When changing this file, you needed to manually restart your server for your changes to take effect.
// - To use your environment variables defined in your .env files, you need to install dotenv, see https://vike.dev/env
// - To use your path aliases defined in your vite.config.js, you need to tell Node.js about them, see https://vike.dev/path-aliases
// If you want Vite to process your server code then use one of these:
// - vavite (https://github.com/cyco130/vavite)
// - See vavite + Vike examples at https://github.com/cyco130/vavite/tree/main/examples
// - vite-node (https://github.com/antfu/vite-node)
// - HatTip (https://github.com/hattipjs/hattip)
// - You can use Bati (https://batijs.github.io/) to scaffold a Vike + HatTip app. Note that Bati generates apps that use the V1 design (https://vike.dev/migration/v1-design) and Vike packages (https://vike.dev/vike-packages)
import config from 'config';
import express from 'express';
import boolParser from 'express-query-boolean';