Skip to content

Commit 430dc00

Browse files
committed
fix demo app types
1 parent 4e0db11 commit 430dc00

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

apps/events/src/components/create-events.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Graph, type Op } from '@graphprotocol/grc-20';
22
import type { Connect } from '@graphprotocol/hypergraph';
33
import { publishOps, useHypergraphApp } from '@graphprotocol/hypergraph-react';
4+
import { mapping } from '../mapping';
45
import { Button } from './ui/button';
56

67
const createEvents = async ({
@@ -12,10 +13,10 @@ const createEvents = async ({
1213

1314
const { id: jobOfferTypeId, ops: createJobOfferTypeOps } = Graph.createEntity({
1415
name: 'My Test Job Offer',
15-
types: ['a107c081-3089-4a94-8208-6a10775557d2'],
16+
types: mapping.JobOffer.typeIds,
1617
values: [
1718
{
18-
property: '20d18713-5352-4e1f-987c-d853bf9f8831',
19+
property: mapping.JobOffer.properties?.salary as string,
1920
value: '80000',
2021
},
2122
],
@@ -24,10 +25,10 @@ const createEvents = async ({
2425

2526
const { id: jobOfferTypeId2, ops: createJobOfferTypeOps2 } = Graph.createEntity({
2627
name: 'My Test Job Offer 2',
27-
types: ['a107c081-3089-4a94-8208-6a10775557d2'],
28+
types: mapping.JobOffer.typeIds,
2829
values: [
2930
{
30-
property: '20d18713-5352-4e1f-987c-d853bf9f8831',
31+
property: mapping.JobOffer.properties?.salary as string,
3132
value: '90000',
3233
},
3334
],
@@ -39,18 +40,18 @@ const createEvents = async ({
3940

4041
const { id: companyTypeId, ops: createCompanyTypeOps } = Graph.createEntity({
4142
name: 'My Test Company',
42-
types: ['e8932986-67a9-4fff-89a6-07f03973014c'],
43+
types: mapping.Company.typeIds,
4344
relations: {
44-
'96beadca-0846-4e56-9628-c196f7f3c4cd': [{ toEntity: jobOfferTypeId }, { toEntity: jobOfferTypeId2 }],
45+
[mapping.Company.relations?.jobOffers as string]: [{ toEntity: jobOfferTypeId }, { toEntity: jobOfferTypeId2 }],
4546
},
4647
});
4748
ops.push(...createCompanyTypeOps);
4849

4950
const { ops: createEventTypeOps } = Graph.createEntity({
5051
name: 'My Test Event',
51-
types: ['6b8dbe76-389f-4bde-acdd-db9d5e387882'],
52+
types: mapping.Event.typeIds,
5253
relations: {
53-
'd8e4ea54-cb8c-4dca-9c2b-64dbbbe78397': [{ toEntity: companyTypeId }],
54+
[mapping.Event.relations?.sponsors as string]: [{ toEntity: companyTypeId }],
5455
},
5556
});
5657
ops.push(...createEventTypeOps);

0 commit comments

Comments
 (0)