forked from abner/for-legacy-web
Hide client behind context.
Use idb for saving data. Allow logins.
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
import { RevoltClient } from "../../../context/revoltjs/RevoltClient";
|
||||
import { AppContext } from "../../../context/revoltjs/RevoltClient";
|
||||
import { useContext } from "preact/hooks";
|
||||
import { Form } from "./Form";
|
||||
|
||||
export function FormCreate() {
|
||||
const { client } = useContext(AppContext);
|
||||
|
||||
return (
|
||||
<Form
|
||||
page="create"
|
||||
callback={async data => {
|
||||
await RevoltClient.register(process.env.API_SERVER as string, data);
|
||||
await client.register(import.meta.env.VITE_API_URL, data);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user