motorin along

This commit is contained in:
Elijah Lucian
2021-07-15 23:06:36 -06:00
parent 8ff02f6149
commit 01a1876b3d
23 changed files with 236 additions and 250 deletions
+2 -1
View File
@@ -12,6 +12,7 @@ type AppContextInterface = {
post: <T, R = T>(path: string, body: Partial<T>) => Promise<R>
create: <T>(path: string, body: Partial<T>) => Promise<T>
destroy: (path: string) => Promise<string>
baseURL?: string
}
const AppContext = createContext<AppContextInterface | null>(null)
@@ -52,7 +53,7 @@ export const AppContextProvider = ({ children, baseURL }: Props) => {
}
return (
<AppContext.Provider value={{ get, patch, post, create, destroy }}>
<AppContext.Provider value={{ get, patch, post, create, destroy, baseURL }}>
{children}
</AppContext.Provider>
)