fixed
This commit is contained in:
parent
e4b6b9b86a
commit
51f422874f
6 changed files with 25 additions and 20 deletions
|
@ -4,11 +4,12 @@ import { initConnection } from "@/components/db-utils";
|
|||
export async function querydb() {
|
||||
try {
|
||||
let db = await initConnection();
|
||||
// console.log(db);
|
||||
let stats = await db.query(`
|
||||
select * from url
|
||||
order by clicks desc
|
||||
limit 50;
|
||||
`);
|
||||
select * from url
|
||||
order by clicks desc
|
||||
limit 50;
|
||||
`);
|
||||
|
||||
// @ts-ignore
|
||||
stats = stats[0];
|
||||
|
|
|
@ -13,7 +13,6 @@ export default function StatsPage() {
|
|||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const result = await querydb();
|
||||
console.log(result);
|
||||
// @ts-ignore
|
||||
setData(result);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue