From fb54e83f4e0b465acf29b217868629713a72637d Mon Sep 17 00:00:00 2001 From: Ehsan Noureddin Moosa Date: Wed, 15 May 2024 09:53:56 +0300 Subject: [PATCH] [kit] improve typescript template for client stub --- kit/internal/tpl/ts/stub.tstmpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kit/internal/tpl/ts/stub.tstmpl b/kit/internal/tpl/ts/stub.tstmpl index d8e22e6b..a58bec76 100644 --- a/kit/internal/tpl/ts/stub.tstmpl +++ b/kit/internal/tpl/ts/stub.tstmpl @@ -102,12 +102,13 @@ this.serverURL = serverURL.replace(/\/$/, ''); export function use{{$methodName}}( stub: {{$serviceName}}Stub, req: {{.Request.Name}}, + reqHeader?: HeadersInit, options?: Partial> ) { return useSWR( [req, '{{$methodName}}'], (req) => { - return stub.{{lowerCamelCase $methodName}}(req[0]) + return stub.{{lowerCamelCase $methodName}}(req[0], reqHeader) }, options )