From 2b4b0d0a397ff8815b81c104c92795c0aedd9cd1 Mon Sep 17 00:00:00 2001 From: Guus van Meerveld Date: Sat, 18 Feb 2023 21:57:34 +0100 Subject: [PATCH] Fixed some type errors --- src/components/BestRepository.tsx | 2 +- src/components/FeaturedRepositories.tsx | 2 +- src/components/User.tsx | 2 +- src/utils/config.ts | 2 +- src/utils/errors.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/BestRepository.tsx b/src/components/BestRepository.tsx index eef6395..052670a 100644 --- a/src/components/BestRepository.tsx +++ b/src/components/BestRepository.tsx @@ -5,7 +5,7 @@ import z from "zod"; import { format as formatTimeAgo } from "timeago.js"; -import { RepositoryResponse } from "@models/responses"; +import { RepositoryResponse } from "@models/git/responses"; const BestRepository: FC<{ repository: z.infer }> = ({ repository }) => { diff --git a/src/components/FeaturedRepositories.tsx b/src/components/FeaturedRepositories.tsx index 8839549..ec19708 100644 --- a/src/components/FeaturedRepositories.tsx +++ b/src/components/FeaturedRepositories.tsx @@ -7,7 +7,7 @@ import Link from "next/link"; import multipleClassNames from "@utils/multipleClassNames"; -import { RepositoryResponse } from "@models/responses"; +import { RepositoryResponse } from "@models/git/responses"; import styles from "./repositories.module.scss"; diff --git a/src/components/User.tsx b/src/components/User.tsx index ed3ccf5..f30f71f 100644 --- a/src/components/User.tsx +++ b/src/components/User.tsx @@ -3,7 +3,7 @@ import z from "zod"; import Image from "next/image"; -import { UserResponse } from "@models/responses"; +import { UserResponse } from "@models/git/responses"; import { giteaServerUrl } from "@utils/config"; import multipleClassNames from "@utils/multipleClassNames"; diff --git a/src/utils/config.ts b/src/utils/config.ts index 0438e8a..8539786 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -16,7 +16,7 @@ export const sessionOptions = { }; export const registrationIsEnabled = - process.env.NEXT_PUBLIC_ALLOW_REGISTRATION !== undefined ? true : false; + process.env.ALLOW_REGISTRATION !== undefined ? true : false; export const saltRoundsForPassword = parseInt(process.env.PASSWORD_SALT_ROUNDS ?? "") || 10; diff --git a/src/utils/errors.ts b/src/utils/errors.ts index b8c7f6c..ed83729 100644 --- a/src/utils/errors.ts +++ b/src/utils/errors.ts @@ -14,4 +14,4 @@ export const unauthorized: Response = baseError( ); export const parseUserInputError: (error: unknown) => string = (error) => - "Failed to parse user input: ".concat(error); + "Failed to parse user input: ".concat(JSON.stringify(error));