Skip to content

Commit bcd16af

Browse files
fix(type): add generic for SmartActionRequestBody (#1024)
Co-authored-by: Justin Martin <[email protected]>
1 parent 15a6747 commit bcd16af

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

types/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ interface ActionRequestBody {
7272
}
7373

7474
// Base body from requests for classic smart action routes
75-
interface SmartActionRequestBody {
75+
interface SmartActionRequestBody<T extends Record<string, any> = Record<string, any>> {
7676
data: {
77-
attributes: ActionRequestAttributes & { values: Record<string, any> },
77+
attributes: ActionRequestAttributes & { values: T },
7878
type: 'custom-action-requests',
7979
},
8080
}
@@ -91,8 +91,8 @@ interface SmartActionHookRequestBody {
9191
}
9292

9393
// Concrete smart action request for classic smart action routes
94-
export interface SmartActionRequest extends ForestRequest {
95-
body: SmartActionRequestBody,
94+
export interface SmartActionRequest<T extends Record<string, any> = Record<string, any>> extends ForestRequest {
95+
body: SmartActionRequestBody<T>,
9696
}
9797

9898
// Request passed to smart action load hooks

0 commit comments

Comments
 (0)