diff --git a/src/components/invitations/Invitations.tsx b/src/components/invitations/Invitations.tsx new file mode 100644 index 0000000..8461a3f --- /dev/null +++ b/src/components/invitations/Invitations.tsx @@ -0,0 +1,45 @@ +import PouchDb from "pouchdb"; +import { Component, createEffect, For } from "solid-js"; +import { createServerAction$ } from "solid-start/server"; + +interface Props {} + +const Invitations: Component = (props) => { + const [invitations, getInvitations] = createServerAction$( + async (values: any) => { + const db = new PouchDb(".db"); + const results = await db.allDocs({ + include_docs: true, + startkey: "invitation/", + endkey: "invitation/\ufff0", + }); + console.log({ caller: "Invitations / serverAction", results }); + return results.rows; + } + ); + + getInvitations(); + + createEffect(() => { + console.log({ + caller: "Invitations", + routeData: invitations.result, + }); + }); + + return ( + + ); +}; + +export default Invitations; diff --git a/src/components/invitations/index.ts b/src/components/invitations/index.ts new file mode 100644 index 0000000..cb3587b --- /dev/null +++ b/src/components/invitations/index.ts @@ -0,0 +1 @@ +export { default } from "./Invitations"; diff --git a/src/routes/invitations/index.tsx b/src/routes/invitations/index.tsx index 36f51ec..c427b96 100644 --- a/src/routes/invitations/index.tsx +++ b/src/routes/invitations/index.tsx @@ -1,7 +1,10 @@ +import Invitations from "~/components/invitations"; + export default () => { return (

Invitations

+
); };