rearranged forum stuff in right folder

main
Alex the Emperor Penguin 3 years ago
parent b01ca12d7e
commit 708f000c7c

@ -0,0 +1,14 @@
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 getItems();

@ -1,6 +1,26 @@
import getItems from "./forum/getItems";
export default async function Page({ children }) {
return(
<h1>
</h1>
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>
);
}

@ -1,37 +1,6 @@
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>
return(
<h1>
</h1>
);
}
Loading…
Cancel
Save