Skip to content

Commit a1533c0

Browse files
committed
remove use delete entity public
1 parent 7b17626 commit a1533c0

5 files changed

Lines changed: 3 additions & 104 deletions

File tree

.changeset/giant-cases-cut.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"connect": patch
55
---
66

7-
bump geo-sdk version to 0.14.0
7+
bump geo-sdk version to 0.14.0 and remove useDeleteEntityPublic
88

apps/events/src/components/playground.tsx

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import { _useDeleteEntityPublic, useEntities, useHypergraphApp, useSpace } from '@graphprotocol/hypergraph-react';
2-
import { useState } from 'react';
1+
import { useEntities, useSpace } from '@graphprotocol/hypergraph-react';
32
import { Event } from '../schema';
4-
import { Button } from './ui/button';
53

64
export const Playground = ({ spaceId }: { spaceId: string }) => {
75
const { data, isLoading, isError, invalidEntities } = useEntities(Event, {
@@ -18,13 +16,9 @@ export const Playground = ({ spaceId }: { spaceId: string }) => {
1816
first: 100,
1917
space: spaceId,
2018
});
21-
const [isDeleting, setIsDeleting] = useState(false);
22-
const { getSmartSessionClient } = useHypergraphApp();
2319

2420
const { name } = useSpace({ mode: 'public', space: spaceId });
2521

26-
const deleteEntity = _useDeleteEntityPublic(Event, { space: spaceId });
27-
2822
console.log({ isLoading, isError, data, invalidEntities });
2923

3024
return (
@@ -35,24 +29,6 @@ export const Playground = ({ spaceId }: { spaceId: string }) => {
3529
{data?.map((event) => (
3630
<div key={event.id}>
3731
<h2>{event.name}</h2>
38-
<Button
39-
onClick={async () => {
40-
setIsDeleting(true);
41-
const walletClient = await getSmartSessionClient();
42-
if (!walletClient) {
43-
alert('Wallet client not found');
44-
return;
45-
}
46-
await deleteEntity({
47-
id: event.id,
48-
walletClient,
49-
});
50-
setIsDeleting(false);
51-
}}
52-
disabled={isDeleting}
53-
>
54-
{isDeleting ? 'Deleting...' : 'Delete'}
55-
</Button>
5632
<pre className="text-xs">{JSON.stringify(event, null, 2)}</pre>
5733
</div>
5834
))}

apps/privy-login-example/src/components/playground.tsx

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import { _useDeleteEntityPublic, useEntities, useHypergraphApp, useSpace } from '@graphprotocol/hypergraph-react';
2-
import { useState } from 'react';
1+
import { useEntities, useSpace } from '@graphprotocol/hypergraph-react';
32
import { Event } from '../schema';
4-
import { Button } from './ui/button';
53

64
export const Playground = ({ spaceId }: { spaceId: string }) => {
75
const { data, isLoading, isError } = useEntities(Event, {
@@ -17,13 +15,9 @@ export const Playground = ({ spaceId }: { spaceId: string }) => {
1715
first: 100,
1816
space: spaceId,
1917
});
20-
const [isDeleting, setIsDeleting] = useState(false);
21-
const { getSmartSessionClient } = useHypergraphApp();
2218

2319
const { name } = useSpace({ mode: 'public', space: spaceId });
2420

25-
const deleteEntity = _useDeleteEntityPublic(Event, { space: spaceId });
26-
2721
console.log({ isLoading, isError, data });
2822

2923
return (
@@ -34,24 +28,6 @@ export const Playground = ({ spaceId }: { spaceId: string }) => {
3428
{data?.map((event) => (
3529
<div key={event.id}>
3630
<h2>{event.name}</h2>
37-
<Button
38-
onClick={async () => {
39-
setIsDeleting(true);
40-
const walletClient = await getSmartSessionClient();
41-
if (!walletClient) {
42-
alert('Wallet client not found');
43-
return;
44-
}
45-
await deleteEntity({
46-
id: event.id,
47-
walletClient,
48-
});
49-
setIsDeleting(false);
50-
}}
51-
disabled={isDeleting}
52-
>
53-
{isDeleting ? 'Deleting...' : 'Delete'}
54-
</Button>
5531
<pre className="text-xs">{JSON.stringify(event, null, 2)}</pre>
5632
</div>
5733
))}

packages/hypergraph-react/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export { usePublicAccountInboxes } from './hooks/usePublicAccountInboxes.js';
2525
export { usePublicSpaces } from './hooks/usePublicSpaces.js';
2626
export { usePublishToPublicSpace } from './hooks/usePublishToSpace.js';
2727
export { generateDeleteOps as _generateDeleteOps } from './internal/generate-delete-ops.js';
28-
export { useDeleteEntityPublic as _useDeleteEntityPublic } from './internal/use-delete-entity-public.js';
2928
export { useEntitiesPrivate as _useEntitiesPrivate } from './internal/use-entities-private.js';
3029
export { useEntitiesPublic as _useEntitiesPublic } from './internal/use-entities-public.js';
3130
export { useEntityPublic as _useEntityPublic } from './internal/use-entity-public.js';

packages/hypergraph-react/src/internal/use-delete-entity-public.tsx

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)