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

Commit

Permalink
fix types in mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
chilijung authored and fabien0102 committed Oct 1, 2018
1 parent fa23738 commit 90f131a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Mutate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface MutateCommonProps {
* to fetch from an entirely different URL.
*
*/
base: string;
base?: string;
/** Options passed into the fetch call. */
requestOptions?: RestfulReactProviderProps["requestOptions"];
/**
Expand Down Expand Up @@ -122,8 +122,8 @@ class ContextlessMutate<TData, TError> extends React.Component<

const requestPath =
verb === "DELETE" && typeof body === "string"
? url.resolve(base, url.resolve(path, body))
: url.resolve(base, path);
? url.resolve(base!, url.resolve(path, body))
: url.resolve(base!, path);
const request = new Request(requestPath, {
method: verb,
body: typeof body === "object" ? JSON.stringify(body) : body,
Expand Down

0 comments on commit 90f131a

Please sign in to comment.