Skip to content

Commit

Permalink
✨ add modified result as well - not pluralized
Browse files Browse the repository at this point in the history
  • Loading branch information
acidjazz committed Jan 22, 2023
1 parent dff47e2 commit 24155c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Actions/GenerateCliOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function __invoke(Collection $models, bool $global = false): string
$plural = Str::plural($name);
$entry .= "{$this->indent}export type $plural = {$name}[]\n";
$entry .= "{$this->indent}export type {$name}Results = Modify<api.MetApiResults, { data: $plural }>\n\n";
$entry .= "{$this->indent}export type {$name}Modified = Modify<api.MetApiModified, { data: $plural }>\n\n";
$entry .= "{$this->indent}export type {$name}Modified = Modify<api.MetApiModified, { data: $name }>\n\n";

$this->output .= $entry;
});
Expand Down
2 changes: 1 addition & 1 deletion src/ModelInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ private function getCode(TypescriptInterface $interface): string
$plural = Str::plural($interface->name);
$code .= "{$this->space}export type $plural = {$interface->name}[]\n";
$code .= "{$this->space}export type {$interface->name}Results = Modify<api.MetApiResults, { data: $plural }>\n\n";
$code .= "{$this->space}export type {$interface->name}Modified = Modify<api.MetApiResponse, { data: $plural }>\n\n";
$code .= "{$this->space}export type {$interface->name}Modified = Modify<api.MetApiResponse, { data: {$interface->name} }>\n\n";

return $code;
}
Expand Down

0 comments on commit 24155c5

Please sign in to comment.