Fix bug in project page

This commit is contained in:
Hazem Krimi
2021-06-21 17:20:38 +01:00
parent 45a80fd377
commit c03325b4b7
+2
View File
@@ -102,6 +102,7 @@ const Project = () => {
id: currentUser?.id!,
},
onCompleted({ getAllProjectsByClientId }) {
if (getAllProjectsByClientId.length > 0)
history.push(`/project/${getAllProjectsByClientId[0].id}`);
},
fetchPolicy: 'network-only',
@@ -112,6 +113,7 @@ const Project = () => {
GetAllUsersQueryVariables
>(GET_ALL_PROJECTS, {
onCompleted({ getAllProjects }) {
if (getAllProjects.length > 0)
history.push(`/project/${getAllProjects[0].id}`);
},
fetchPolicy: 'network-only',