Skip to content

Commit 580cf09

Browse files
committed
add allocated
1 parent eaa8a3e commit 580cf09

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

apps/events/src/routes/bounties.lazy.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { Bounty } from '@/schema';
12
import { useEntities } from '@graphprotocol/hypergraph-react';
23
import { createLazyFileRoute } from '@tanstack/react-router';
3-
import { Bounty } from '@/schema';
44

55
export const Route = createLazyFileRoute('/bounties')({
66
component: RouteComponent,
@@ -19,6 +19,9 @@ function RouteComponent() {
1919
filter: {
2020
interestedIn: { entityId: PERSON_ENTITY_ID },
2121
},
22+
include: {
23+
allocated: {},
24+
},
2225
});
2326

2427
return (
@@ -37,6 +40,9 @@ function RouteComponent() {
3740
<h2 className="font-semibold">{bounty.name}</h2>
3841
{bounty.description && <p className="text-sm text-gray-600">{bounty.description}</p>}
3942
<p className="text-xs text-gray-400 mt-1">{bounty.id}</p>
43+
<p className="text-xs text-gray-400 mt-1">
44+
Allocated to: {bounty.allocated.map((allocated) => allocated.name).join(', ')}
45+
</p>
4046
</li>
4147
))}
4248
</ul>

apps/events/src/schema.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,18 +372,22 @@ export const PersonBacklink = Entity.Schema(
372372
},
373373
);
374374

375+
export const ALLOCATED_PROPERTY_ID = Id('cfeb642223c54df4b3f9375a489d9e22');
376+
375377
export const Bounty = Entity.Schema(
376378
{
377379
name: Type.String,
378380
description: Type.optional(Type.String),
379381
interestedIn: Type.Backlink(PersonBacklink),
382+
allocated: Type.Relation(PersonBacklink),
380383
},
381384
{
382385
types: [Id('808af0bad5884e3391f09dd4b25e18be')],
383386
properties: {
384387
name: Id(SystemIds.NAME_PROPERTY),
385388
description: Id(SystemIds.DESCRIPTION_PROPERTY),
386389
interestedIn: Id('ff7e1b4444a2419187324e6c222afe07'),
390+
allocated: ALLOCATED_PROPERTY_ID,
387391
},
388392
},
389393
);

0 commit comments

Comments
 (0)