Skip to content

Commit

Permalink
[kit] improve typescript template for client stub
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsannm committed May 15, 2024
1 parent a64fa92 commit fb54e83
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kit/internal/tpl/ts/stub.tstmpl
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,13 @@ this.serverURL = serverURL.replace(/\/$/, '');
export function use{{$methodName}}(
stub: {{$serviceName}}Stub,
req: {{.Request.Name}},
reqHeader?: HeadersInit,
options?: Partial<SWRConfiguration<{{.Response.Name}}>>
) {
return useSWR(
[req, '{{$methodName}}'],
(req) => {
return stub.{{lowerCamelCase $methodName}}(req[0])
return stub.{{lowerCamelCase $methodName}}(req[0], reqHeader)
},
options
)
Expand Down

0 comments on commit fb54e83

Please sign in to comment.