refractor: added proper types to getServerSideProps context (#321)

* fix: redirection after login

* refractor: added proper types to getServerSideProps context
This commit is contained in:
Dakshesh Jain 2023-02-23 17:50:37 +05:30 committed by GitHub
parent 1e63c5b1b3
commit a550f4b161
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 12 deletions

View File

@ -20,7 +20,7 @@ import { Button, CustomSelect, Loader } from "components/ui";
import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs";
// types
import { IProject, IWorkspace } from "types";
import type { NextPageContext, NextPage } from "next";
import type { NextPage, GetServerSidePropsContext } from "next";
// fetch-keys
import { PROJECTS_LIST, PROJECT_DETAILS, WORKSPACE_MEMBERS } from "constants/fetch-keys";
@ -251,7 +251,7 @@ const ControlSettings: NextPage<TControlSettingsProps> = (props) => {
);
};
export const getServerSideProps = async (ctx: NextPageContext) => {
export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
const projectId = ctx.query.projectId as string;
const workspaceSlug = ctx.query.workspaceSlug as string;

View File

@ -17,7 +17,7 @@ import { Button } from "components/ui";
import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs";
// types
import { IProject, UserAuth } from "types";
import type { NextPage, NextPageContext } from "next";
import type { NextPage, GetServerSidePropsContext } from "next";
// fetch-keys
import { PROJECTS_LIST, PROJECT_DETAILS } from "constants/fetch-keys";
@ -168,7 +168,7 @@ const FeaturesSettings: NextPage<UserAuth> = (props) => {
);
};
export const getServerSideProps = async (ctx: NextPageContext) => {
export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
const projectId = ctx.query.projectId as string;
const workspaceSlug = ctx.query.workspaceSlug as string;

View File

@ -25,7 +25,7 @@ import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs";
// helpers
import { debounce } from "helpers/common.helper";
// types
import type { NextPage, NextPageContext } from "next";
import type { NextPage, GetServerSidePropsContext } from "next";
// fetch-keys
import { PROJECTS_LIST, PROJECT_DETAILS, WORKSPACE_DETAILS } from "constants/fetch-keys";
// constants
@ -339,7 +339,7 @@ const GeneralSettings: NextPage<UserAuth> = (props) => {
);
};
export const getServerSideProps = async (ctx: NextPageContext) => {
export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
const projectId = ctx.query.projectId as string;
const workspaceSlug = ctx.query.workspaceSlug as string;

View File

@ -25,7 +25,7 @@ import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs";
import { PlusIcon } from "@heroicons/react/24/outline";
// types
import { IIssueLabels, UserAuth } from "types";
import type { NextPageContext, NextPage } from "next";
import type { GetServerSidePropsContext, NextPage } from "next";
// fetch-keys
import { PROJECT_DETAILS, PROJECT_ISSUE_LABELS } from "constants/fetch-keys";
@ -173,7 +173,7 @@ const LabelsSettings: NextPage<UserAuth> = (props) => {
);
};
export const getServerSideProps = async (ctx: NextPageContext) => {
export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
const projectId = ctx.query.projectId as string;
const workspaceSlug = ctx.query.workspaceSlug as string;

View File

@ -23,7 +23,7 @@ import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs";
// icons
import { PlusIcon } from "@heroicons/react/24/outline";
// types
import type { NextPage, NextPageContext } from "next";
import type { NextPage, GetServerSidePropsContext } from "next";
// fetch-keys
import {
PROJECT_DETAILS,
@ -313,7 +313,7 @@ const MembersSettings: NextPage<TMemberSettingsProps> = (props) => {
);
};
export const getServerSideProps = async (ctx: NextPageContext) => {
export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
const projectId = ctx.query.projectId as string;
const workspaceSlug = ctx.query.workspaceSlug as string;

View File

@ -27,7 +27,7 @@ import { PlusIcon } from "@heroicons/react/24/outline";
import { getStatesList, orderStateGroups } from "helpers/state.helper";
// types
import { UserAuth } from "types";
import type { NextPage, NextPageContext } from "next";
import type { NextPage, GetServerSidePropsContext } from "next";
// fetch-keys
import { PROJECT_DETAILS, STATE_LIST } from "constants/fetch-keys";
@ -155,7 +155,7 @@ const StatesSettings: NextPage<UserAuth> = (props) => {
);
};
export const getServerSideProps = async (ctx: NextPageContext) => {
export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
const projectId = ctx.query.projectId as string;
const workspaceSlug = ctx.query.workspaceSlug as string;