Skip to content

Commit f7f2839

Browse files
committed
Declare Resource.tools relation for policies
1 parent c84e94a commit f7f2839

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/components/tools/tool-usage/dto/tool-usage.dto.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Field, ObjectType } from '@nestjs/graphql';
2+
import { patchMethod } from '@seedcompany/common';
23
import {
34
Resource,
45
type Secured,
@@ -37,3 +38,13 @@ declare module '~/core/resources/map' {
3738
ToolUsage: typeof e.Tool.Usage;
3839
}
3940
}
41+
42+
declare module '~/common/resource.dto' {
43+
export interface DeclareResourceRelations {
44+
readonly tools: readonly [typeof ToolUsage];
45+
}
46+
}
47+
patchMethod(Resource, 'Relations', (orig) => () => ({
48+
...orig(),
49+
tools: [ToolUsage] as const,
50+
}));

0 commit comments

Comments
 (0)