Using a real uuid
This commit is contained in:
1 parent
fbdb652bd7
commit
c8cb8d47a2
4 files changed
+36
-8
No files matched your search
@@ -5,18 +5,20 @@ import { TextField, Button } from "@kobalte/core";
|
||||
import "./style.css";
|
||||
import { createServerAction$ } from "solid-start/server";
|
||||
import PouchDb from "pouchdb";
|
||||
import { v4 as uuid } from "uuid";
|
||||
|
||||
interface Props {}
|
||||
|
||||
const Invitation: Component<Props> = (props) => {
|
||||
const [saving, save] = createServerAction$(async (values: any) => {
|
||||
const db = new PouchDb(".db");
|
||||
const uuid = createUniqueId();
|
||||
const id = `invitation/${uuid()}}`;
|
||||
await db.put({
|
||||
_id: `invitation/${uuid}`,
|
||||
_id: id,
|
||||
type: "invitation",
|
||||
doc: values,
|
||||
});
|
||||
return id;
|
||||
});
|
||||
|
||||
const submitHandler = (values: any, context: any) => {
|
||||
|
||||
@@ -23,7 +23,7 @@ const Invitations: Component<Props> = (props) => {
|
||||
createEffect(() => {
|
||||
console.log({
|
||||
caller: "Invitations",
|
||||
routeData: invitations.result,
|
||||
invitations: invitations.result,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user