Skip to content

Commit 9d13ad2

Browse files
committed
more fixes
1 parent 6e336a6 commit 9d13ad2

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

dist/index.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5241,7 +5241,7 @@ var templateExportHook = {"1":function(container,depth0,helpers,partials,data) {
52415241
return undefined
52425242
};
52435243

5244-
return ((stack1 = lookupProperty(helpers,"equals").call(depth0 != null ? depth0 : (container.nullContext || {}),lookupProperty(depth0,"method"),"GET",{"name":"equals","hash":{},"fn":container.program(5, data, 0),"inverse":container.program(28, data, 0),"data":data,"loc":{"start":{"line":15,"column":2},"end":{"line":78,"column":13}}})) != null ? stack1 : "");
5244+
return ((stack1 = lookupProperty(helpers,"equals").call(depth0 != null ? depth0 : (container.nullContext || {}),lookupProperty(depth0,"method"),"GET",{"name":"equals","hash":{},"fn":container.program(5, data, 0),"inverse":container.program(28, data, 0),"data":data,"loc":{"start":{"line":15,"column":2},"end":{"line":77,"column":13}}})) != null ? stack1 : "");
52455245
},"5":function(container,depth0,helpers,partials,data) {
52465246
var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
52475247
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
@@ -5271,7 +5271,7 @@ var templateExportHook = {"1":function(container,depth0,helpers,partials,data) {
52715271
+ "("
52725272
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,lookupProperty(depth0,"parameters"),{"name":"if","hash":{},"fn":container.program(12, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":20,"column":52},"end":{"line":28,"column":18}}})) != null ? stack1 : "")
52735273
+ ");\n },\n ...options\n });\n };\n\n"
5274-
+ ((stack1 = lookupProperty(helpers,"contains").call(alias1,lookupProperty(depth0,"name"),"List",{"name":"contains","hash":{},"fn":container.program(18, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":34,"column":3},"end":{"line":62,"column":16}}})) != null ? stack1 : "")
5274+
+ ((stack1 = lookupProperty(helpers,"contains").call(alias1,lookupProperty(depth0,"pascalcase"),lookupProperty(depth0,"name"),"List",{"name":"contains","hash":{},"fn":container.program(18, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":34,"column":3},"end":{"line":61,"column":16}}})) != null ? stack1 : "")
52755275
+ "\n\n";
52765276
},"6":function(container,depth0,helpers,partials,data) {
52775277
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
@@ -5342,7 +5342,7 @@ var templateExportHook = {"1":function(container,depth0,helpers,partials,data) {
53425342
+ "."
53435343
+ ((stack1 = container.lambda(container.strict(depth0, "name", {"start":{"line":39,"column":47},"end":{"line":39,"column":51}} ), depth0)) != null ? stack1 : "")
53445344
+ "("
5345-
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,lookupProperty(depth0,"parameters"),{"name":"if","hash":{},"fn":container.program(19, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":39,"column":54},"end":{"line":52,"column":18}}})) != null ? stack1 : "")
5345+
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,lookupProperty(depth0,"parameters"),{"name":"if","hash":{},"fn":container.program(19, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":39,"column":54},"end":{"line":51,"column":18}}})) != null ? stack1 : "")
53465346
+ ");\n },\n initialPageParam: null,\n getNextPageParam: (lastPage, allPages) => {\n const params = new URLSearchParams(lastPage?.next_url?.split('?')?.[1]);\n return params.get('cursor');\n },\n ...options\n });\n };\n";
53475347
},"19":function(container,depth0,helpers,partials,data) {
53485348
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
@@ -5353,8 +5353,8 @@ var templateExportHook = {"1":function(container,depth0,helpers,partials,data) {
53535353
};
53545354

53555355
return "{\n"
5356-
+ ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),lookupProperty(depth0,"parameters"),{"name":"each","hash":{},"fn":container.program(20, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":40,"column":9},"end":{"line":50,"column":18}}})) != null ? stack1 : "")
5357-
+ " cursor: pageParam,\n }";
5356+
+ ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),lookupProperty(depth0,"parameters"),{"name":"each","hash":{},"fn":container.program(20, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":40,"column":9},"end":{"line":49,"column":18}}})) != null ? stack1 : "")
5357+
+ " cursor: pageParam as string,\n }";
53585358
},"20":function(container,depth0,helpers,partials,data) {
53595359
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
53605360
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
@@ -5363,7 +5363,7 @@ var templateExportHook = {"1":function(container,depth0,helpers,partials,data) {
53635363
return undefined
53645364
};
53655365

5366-
return ((stack1 = lookupProperty(helpers,"equals").call(depth0 != null ? depth0 : (container.nullContext || {}),lookupProperty(depth0,"name"),"cursor",{"name":"equals","hash":{},"fn":container.program(21, data, 0),"inverse":container.program(23, data, 0),"data":data,"loc":{"start":{"line":41,"column":10},"end":{"line":49,"column":21}}})) != null ? stack1 : "")
5366+
return ((stack1 = lookupProperty(helpers,"equals").call(depth0 != null ? depth0 : (container.nullContext || {}),lookupProperty(depth0,"name"),"cursor",{"name":"equals","hash":{},"fn":container.program(21, data, 0),"inverse":container.program(23, data, 0),"data":data,"loc":{"start":{"line":41,"column":10},"end":{"line":48,"column":21}}})) != null ? stack1 : "")
53675367
+ ",\n";
53685368
},"21":function(container,depth0,helpers,partials,data) {
53695369
return "\n";
@@ -5375,7 +5375,7 @@ var templateExportHook = {"1":function(container,depth0,helpers,partials,data) {
53755375
return undefined
53765376
};
53775377

5378-
return ((stack1 = lookupProperty(helpers,"if").call(depth0 != null ? depth0 : (container.nullContext || {}),lookupProperty(depth0,"name"),{"name":"if","hash":{},"fn":container.program(24, data, 0),"inverse":container.program(26, data, 0),"data":data,"loc":{"start":{"line":44,"column":11},"end":{"line":48,"column":18}}})) != null ? stack1 : "")
5378+
return ((stack1 = lookupProperty(helpers,"if").call(depth0 != null ? depth0 : (container.nullContext || {}),lookupProperty(depth0,"name"),{"name":"if","hash":{},"fn":container.program(24, data, 0),"inverse":container.program(26, data, 0),"data":data,"loc":{"start":{"line":44,"column":11},"end":{"line":47,"column":18}}})) != null ? stack1 : "")
53795379
+ " ";
53805380
},"24":function(container,depth0,helpers,partials,data) {
53815381
var stack1;
@@ -5384,7 +5384,7 @@ var templateExportHook = {"1":function(container,depth0,helpers,partials,data) {
53845384
+ ((stack1 = container.lambda(container.strict(depth0, "name", {"start":{"line":45,"column":14},"end":{"line":45,"column":18}} ), depth0)) != null ? stack1 : "")
53855385
+ ",\n";
53865386
},"26":function(container,depth0,helpers,partials,data) {
5387-
return " _,\n";
5387+
return "";
53885388
},"28":function(container,depth0,helpers,partials,data) {
53895389
var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
53905390
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
@@ -5394,19 +5394,19 @@ var templateExportHook = {"1":function(container,depth0,helpers,partials,data) {
53945394
};
53955395

53965396
return " export const use"
5397-
+ ((stack1 = lookupProperty(helpers,"pascalCase").call(alias1,lookupProperty(depth0,"name"),{"name":"pascalCase","hash":{},"data":data,"loc":{"start":{"line":66,"column":19},"end":{"line":66,"column":38}}})) != null ? stack1 : "")
5397+
+ ((stack1 = lookupProperty(helpers,"pascalCase").call(alias1,lookupProperty(depth0,"name"),{"name":"pascalCase","hash":{},"data":data,"loc":{"start":{"line":65,"column":19},"end":{"line":65,"column":38}}})) != null ? stack1 : "")
53985398
+ " = (options?: Partial<UseMutationOptions<"
53995399
+ ((stack1 = container.invokePartial(lookupProperty(partials,"result"),depth0,{"name":"result","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "")
54005400
+ ">>) => {\n return useMutation<"
54015401
+ ((stack1 = container.invokePartial(lookupProperty(partials,"result"),depth0,{"name":"result","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "")
54025402
+ ", any, any>({\n mutationFn: async ("
54035403
+ ((stack1 = container.invokePartial(lookupProperty(partials,"parameters"),depth0,{"name":"parameters","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "")
54045404
+ ") => {\n return client."
5405-
+ ((stack1 = lookupProperty(helpers,"camelCase").call(alias1,lookupProperty(depth0,"service"),{"name":"camelCase","hash":{},"data":data,"loc":{"start":{"line":69,"column":21},"end":{"line":69,"column":42}}})) != null ? stack1 : "")
5405+
+ ((stack1 = lookupProperty(helpers,"camelCase").call(alias1,lookupProperty(depth0,"service"),{"name":"camelCase","hash":{},"data":data,"loc":{"start":{"line":68,"column":21},"end":{"line":68,"column":42}}})) != null ? stack1 : "")
54065406
+ "."
5407-
+ ((stack1 = container.lambda(container.strict(depth0, "name", {"start":{"line":69,"column":45},"end":{"line":69,"column":49}} ), depth0)) != null ? stack1 : "")
5407+
+ ((stack1 = container.lambda(container.strict(depth0, "name", {"start":{"line":68,"column":45},"end":{"line":68,"column":49}} ), depth0)) != null ? stack1 : "")
54085408
+ "("
5409-
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,lookupProperty(depth0,"parameters"),{"name":"if","hash":{},"fn":container.program(29, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":69,"column":52},"end":{"line":73,"column":15}}})) != null ? stack1 : "")
5409+
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,lookupProperty(depth0,"parameters"),{"name":"if","hash":{},"fn":container.program(29, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":68,"column":52},"end":{"line":72,"column":15}}})) != null ? stack1 : "")
54105410
+ ");\n },\n ...options\n });\n };\n";
54115411
},"29":function(container,depth0,helpers,partials,data) {
54125412
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
@@ -5417,13 +5417,13 @@ var templateExportHook = {"1":function(container,depth0,helpers,partials,data) {
54175417
};
54185418

54195419
return "{\n"
5420-
+ ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),lookupProperty(depth0,"parameters"),{"name":"each","hash":{},"fn":container.program(30, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":70,"column":9},"end":{"line":72,"column":18}}})) != null ? stack1 : "")
5420+
+ ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),lookupProperty(depth0,"parameters"),{"name":"each","hash":{},"fn":container.program(30, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":69,"column":9},"end":{"line":71,"column":18}}})) != null ? stack1 : "")
54215421
+ " }";
54225422
},"30":function(container,depth0,helpers,partials,data) {
54235423
var stack1;
54245424

54255425
return " "
5426-
+ ((stack1 = container.lambda(container.strict(depth0, "name", {"start":{"line":71,"column":13},"end":{"line":71,"column":17}} ), depth0)) != null ? stack1 : "")
5426+
+ ((stack1 = container.lambda(container.strict(depth0, "name", {"start":{"line":70,"column":13},"end":{"line":70,"column":17}} ), depth0)) != null ? stack1 : "")
54275427
+ ",\n";
54285428
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
54295429
var stack1, alias1=container.strict, alias2=container.lambda, alias3=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
@@ -5441,7 +5441,7 @@ var templateExportHook = {"1":function(container,depth0,helpers,partials,data) {
54415441
+ "\nconst client = new "
54425442
+ ((stack1 = alias2(alias1(depth0, "clientName", {"start":{"line":12,"column":21},"end":{"line":12,"column":31}} ), depth0)) != null ? stack1 : "")
54435443
+ "();\n\n"
5444-
+ ((stack1 = lookupProperty(helpers,"each").call(alias3,lookupProperty(depth0,"operations"),{"name":"each","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":14,"column":0},"end":{"line":79,"column":9}}})) != null ? stack1 : "");
5444+
+ ((stack1 = lookupProperty(helpers,"each").call(alias3,lookupProperty(depth0,"operations"),{"name":"each","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":14,"column":0},"end":{"line":78,"column":9}}})) != null ? stack1 : "");
54455445
},"usePartial":true,"useData":true};
54465446

54475447
var templateIndex = {"1":function(container,depth0,helpers,partials,data) {

src/templates/exportHook.hbs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const client = new {{clientName}}();
3131
});
3232
};
3333

34-
{{#contains name 'List'}}
34+
{{#contains pascalcase name 'List'}}
3535
export const useInfinite{{pascalCase name}} = ({{#if parameters}}{{>parameters}}{{else}}_: any{{/if}}, options?: Partial<UseInfiniteQueryOptions<any>>) => {
3636
return useInfiniteQuery<{{>result}}>({
3737
queryKey: ['{{ camelCase service}}', '{{ camelCase name }}', {{#each parameters}}{{name}}, {{/each}}],
@@ -44,11 +44,10 @@ const client = new {{clientName}}();
4444
{{#if name}}
4545
{{name}},
4646
{{else}}
47-
_,
4847
{{/if}}
4948
{{/equals}},
5049
{{/each}}
51-
cursor: pageParam,
50+
cursor: pageParam as string,
5251
}{{/if}});
5352
},
5453
initialPageParam: null,

0 commit comments

Comments
 (0)