Skip to content

Commit 15e40ef

Browse files
committed
Tighten types on Product fields
1 parent b0e562f commit 15e40ef

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/components/product/dto/product.dto.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
import { type SetDbType } from '~/core/database';
1919
import { type SetChangeType } from '~/core/database/changes';
2020
import { e } from '~/core/gel';
21-
import { RegisterResource } from '~/core/resources';
21+
import { type LinkTo, RegisterResource } from '~/core/resources';
2222
import { type DbScriptureReferences } from '../../scripture';
2323
import {
2424
type ScriptureRangeInput,
@@ -55,8 +55,8 @@ export class Product extends Producible {
5555
static readonly Parent = () =>
5656
import('../../engagement/dto').then((m) => m.LanguageEngagement);
5757

58-
readonly engagement: ID;
59-
readonly project: ID;
58+
readonly engagement: LinkTo<'LanguageEngagement'>;
59+
readonly project: LinkTo<'Project'>;
6060

6161
@Field()
6262
@DbLabel('ProductMedium')

src/components/product/product.resolver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ export class ProductResolver {
7575
@Info(Fields, IsOnlyId) onlyId: boolean,
7676
) {
7777
return onlyId
78-
? { id: product.project }
79-
: await projects.load({ id: product.project, view: { active: true } });
78+
? { id: product.project.id }
79+
: await projects.load({ id: product.project.id, view: { active: true } });
8080
}
8181

8282
@ResolveField(() => ProductApproach, { nullable: true })

0 commit comments

Comments
 (0)