[WEB-1608] fix: deleted project errors (#4820)

* dev: fix project not found error

* [WEB-1608] chore: fix no projects found logic.

---------

Co-authored-by: pablohashescobar <nikhilschacko@gmail.com>
This commit is contained in:
Prateek Shourya 2024-06-14 16:39:25 +05:30 committed by GitHub
parent cfbc0cf2e1
commit d1bfed950a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -240,6 +240,12 @@ class ProjectViewSet(BaseViewSet):
)
).first()
if project is None:
return Response(
{"error": "Project does not exist"},
status=status.HTTP_404_NOT_FOUND,
)
serializer = ProjectListSerializer(project)
return Response(serializer.data, status=status.HTTP_200_OK)

View File

@ -116,7 +116,7 @@ export const ProjectAuthWrapper: FC<IProjectAuthWrapper> = observer((props) => {
if (projectExists && projectId && hasPermissionToProject[projectId.toString()] === false) return <JoinProject />;
// check if the project info is not found.
if (!projectExists && projectId && hasPermissionToProject[projectId.toString()] === false)
if (!projectExists && projectId && !!hasPermissionToProject[projectId.toString()] === false)
return (
<div className="container grid h-screen place-items-center bg-custom-background-100">
<EmptyState