feat: created `useProject` hook

pull/68/head
Samuel Rowe 3 years ago
parent caca17ca40
commit 99f935f81b

@ -0,0 +1 @@
export { default as useProject } from "./useProject";

@ -0,0 +1,17 @@
import axios from "axios"
const useProject = (uuid?: string) => {
return useQuery(["project", uuid], async () => {
if (!uuid) {
return;
}
const { data } = await axios.get(`${API_SERVER_URL}/projects/${uuid}/`, {
headers: {
"Content-Type": "application/json"
}
})
return data
})
}
export default useProject;
Loading…
Cancel
Save