acacode / swagger-typescript-api

Generate the API Client for Fetch or Axios from an OpenAPI Specification
MIT License
3.08k stars 338 forks source link

Destructuring assignment in the parameter list #771

Open thuong-infotrack-vn opened 3 weeks ago

thuong-infotrack-vn commented 3 weeks ago

Hi currently I'm using react-query mutation How can I turn this

reportGetNoLawyersPerDay = (
  query?: {
    /** @format date-time */
    TimeFrom?: string;
    /** @format date-time */
    TimeTo?: string;
  },
  params: RequestParams = {}
);

into this

reportGetNoLawyersPerDay = ({
  query,
  params = {}
}: {
  query?: {
    /** @format date-time */
    TimeFrom?: string;
    /** @format date-time */
    TimeTo?: string;
  };
  params?: RequestParams;
});

because I wanna use only one parameter for that function, is there any option for this?