From bcd16af41f70d953258f8f5b745eab30e89d08bb Mon Sep 17 00:00:00 2001 From: Arnaud MONCEL Date: Tue, 25 Oct 2022 15:53:56 +0200 Subject: [PATCH] fix(type): add generic for SmartActionRequestBody (#1024) Co-authored-by: Justin Martin --- types/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index acec6606..7f9038ca 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -72,9 +72,9 @@ interface ActionRequestBody { } // Base body from requests for classic smart action routes -interface SmartActionRequestBody { +interface SmartActionRequestBody = Record> { data: { - attributes: ActionRequestAttributes & { values: Record }, + attributes: ActionRequestAttributes & { values: T }, type: 'custom-action-requests', }, } @@ -91,8 +91,8 @@ interface SmartActionHookRequestBody { } // Concrete smart action request for classic smart action routes -export interface SmartActionRequest extends ForestRequest { - body: SmartActionRequestBody, +export interface SmartActionRequest = Record> extends ForestRequest { + body: SmartActionRequestBody, } // Request passed to smart action load hooks