You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

import PocketBase from "pocketbase";
async function getItems() {
const client = new PocketBase('https://backend.saachen.lu');
const adminAuthData = await client.admins.authViaEmail(process.env.USERNAME, process.env.PASSWORD);
//console.log(adminAuthData);
const resultList = await client.records.getList('forums', 1, 50, {
filter: 'created >= "2022-01-01 00:00:00"',
});
console.log(resultList);
return resultList;
}
export default async function Page({ children }) {
const resultList = await getItems();
return (
<div>
<h1>hi</h1>
<div>
{resultList.items.map((item, i) => (
<div key={i}>
// Show all things which you want
<br/>
{i}
<br/>
{item.title}
<br/>
{i}
<br/>
{item.description}
</div>
))
}
</div>
</div>
);
}
export default Page;