Skip to content
This repository has been archived by the owner on Nov 11, 2023. It is now read-only.

Add TBody to Mutate to be able to type the body #59

Closed
fabien0102 opened this issue Sep 26, 2018 · 3 comments
Closed

Add TBody to Mutate to be able to type the body #59

fabien0102 opened this issue Sep 26, 2018 · 3 comments

Comments

@fabien0102
Copy link
Contributor

fabien0102 commented Sep 26, 2018

Is your feature request related to a problem? Please describe.
Actually we can't type the body when we are using the Mutate component.

Describe the solution you'd like

// My `TBody`
interface HamburgerBody {
  size?: "small" | "normal" | "large" | "xlarge";
  haveOnions?: boolean;
  meatType?: "pork" | "beaf" | "dog"
}

<Mutate<TData, TError, HamburgerBody> verb="POST" path="/find-the-best-burger">
  {findTheBestBurger => (
    <button onClick={() => findTheBestBurger({size: "xlarge", haveOnions: true})}>
       I'm starving
     </button>)}
</Mutate>

Additional context
This will be very very useful and powerful in combinaison of the open-api generator (#28)

@fabien0102 fabien0102 added the good first issue Good for newcomers label Sep 26, 2018
@TejasQ
Copy link
Contributor

TejasQ commented Sep 27, 2018

+1

@fabien0102 fabien0102 removed the good first issue Good for newcomers label Oct 23, 2018
@fabien0102
Copy link
Contributor Author

fabien0102 commented Oct 24, 2018

Implemented in 813e41c (#28)

@TejasQ
Copy link
Contributor

TejasQ commented Oct 24, 2018

TIME TO CHERRY PICK 🍒

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants