mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 12:56:05 +00:00
added pausing to event manager, added context aware entity schemas, fixed typings, first boot event, improved useEntityQuery mutation behavior
This commit is contained in:
@@ -101,7 +101,7 @@ export function DataEntityUpdate({ params }) {
|
||||
data: {
|
||||
data: data as any,
|
||||
entity: entity.toJSON(),
|
||||
schema: entity.toSchema(true),
|
||||
schema: entity.toSchema({ clean: true }),
|
||||
form: Form.state.values,
|
||||
state: Form.state
|
||||
}
|
||||
|
||||
@@ -39,12 +39,12 @@ export default function SWRAndAPI() {
|
||||
e.preventDefault();
|
||||
if (!comment) return;
|
||||
|
||||
await r.mutate(async () => {
|
||||
/*await r.mutate(async () => {
|
||||
const res = await r.api.data.updateOne("comments", comment.id, {
|
||||
content: text
|
||||
});
|
||||
return res.data;
|
||||
});
|
||||
});*/
|
||||
|
||||
return false;
|
||||
}}
|
||||
|
||||
@@ -13,7 +13,9 @@ export default function SwrAndDataApi() {
|
||||
|
||||
function QueryDataApi() {
|
||||
const [text, setText] = useState("");
|
||||
const { data, update, ...r } = useEntityQuery("comments", 2);
|
||||
const { data, update, ...r } = useEntityQuery("comments", 2, {
|
||||
sort: { by: "id", dir: "desc" }
|
||||
});
|
||||
const comment = data ? data : null;
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user