chore: disable API calls for un-authorized users (#3144)
* fix: disable api calls if user doesn't have access * chore: remove permissions from component level * chore: rmeove console log and organize import statements
This commit is contained in:
parent
3d83101f69
commit
8a1a6c6f62
21 changed files with 139 additions and 86 deletions
|
|
@ -18,11 +18,7 @@ import { Spinner } from "@plane/ui";
|
|||
|
||||
export const ProjectViewLayoutRoot: React.FC = observer(() => {
|
||||
const router = useRouter();
|
||||
const { workspaceSlug, projectId, viewId } = router.query as {
|
||||
workspaceSlug: string;
|
||||
projectId: string;
|
||||
viewId?: string;
|
||||
};
|
||||
const { workspaceSlug, projectId, viewId } = router.query;
|
||||
|
||||
const {
|
||||
viewIssues: { loader, getIssues, fetchIssues },
|
||||
|
|
@ -31,8 +27,8 @@ export const ProjectViewLayoutRoot: React.FC = observer(() => {
|
|||
|
||||
useSWR(workspaceSlug && projectId && viewId ? `PROJECT_ISSUES_V3_${workspaceSlug}_${projectId}` : null, async () => {
|
||||
if (workspaceSlug && projectId && viewId) {
|
||||
await fetchFilters(workspaceSlug, projectId, viewId);
|
||||
await fetchIssues(workspaceSlug, projectId, getIssues ? "mutation" : "init-loader");
|
||||
await fetchFilters(workspaceSlug.toString(), projectId.toString(), viewId.toString());
|
||||
await fetchIssues(workspaceSlug.toString(), projectId.toString(), getIssues ? "mutation" : "init-loader");
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue