|
1 | 1 | import { Id, type Op, Relation, Triple, type Value } from '@graphprotocol/grc-20'; |
2 | | -import { Entity } from '@graphprotocol/hypergraph'; |
| 2 | +import { type Entity, Type } from '@graphprotocol/hypergraph'; |
3 | 3 | import { useHypergraph } from '../HypergraphSpaceContext.js'; |
4 | 4 | import type { DiffEntry } from '../types.js'; |
5 | 5 |
|
@@ -31,30 +31,30 @@ export function useGenerateUpdateOps<const S extends Entity.AnyNoContext>(type: |
31 | 31 | const rawValue = propertyDiff.new; |
32 | 32 |
|
33 | 33 | let value: Value; |
34 | | - if (type.fields[key] === Entity.Checkbox) { |
| 34 | + if (type.fields[key] === Type.Checkbox) { |
35 | 35 | value = { |
36 | 36 | type: 'CHECKBOX', |
37 | 37 | value: rawValue ? '1' : '0', |
38 | 38 | }; |
39 | | - } else if (type.fields[key] === Entity.Point) { |
| 39 | + } else if (type.fields[key] === Type.Point) { |
40 | 40 | value = { |
41 | 41 | type: 'POINT', |
42 | 42 | // @ts-expect-error: must be an array of numbers |
43 | 43 | value: rawValue.join(','), |
44 | 44 | }; |
45 | | - } else if (type.fields[key] === Entity.Url) { |
| 45 | + } else if (type.fields[key] === Type.Url) { |
46 | 46 | value = { |
47 | 47 | type: 'URL', |
48 | 48 | // @ts-expect-error: must be a URL |
49 | 49 | value: rawValue.toString(), |
50 | 50 | }; |
51 | | - } else if (type.fields[key] === Entity.Date) { |
| 51 | + } else if (type.fields[key] === Type.Date) { |
52 | 52 | value = { |
53 | 53 | type: 'TIME', |
54 | 54 | // @ts-expect-error: must be a Date |
55 | 55 | value: rawValue.toISOString(), |
56 | 56 | }; |
57 | | - } else if (type.fields[key] === Entity.Number) { |
| 57 | + } else if (type.fields[key] === Type.Number) { |
58 | 58 | value = { |
59 | 59 | type: 'NUMBER', |
60 | 60 | // @ts-expect-error: must be a number |
|
0 commit comments