Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
2 changes: 1 addition & 1 deletion apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"^@repo/backend/(.*)$": "<rootDir>/src/$1"
},
"setupFilesAfterEnv": [
"<rootDir>/src/jest.setup.ts"
"<rootDir>/jest.setup.ts"
]
},
"dependencies": {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion apps/backend/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createServer } from "@repo/backend/server";
import envValidate from "@repo/backend/config";
import envValidate from "@repo/backend/env";
import { dbPush, dbReset, dbSeed, dbWaitForConnection } from "@repo/database";

envValidate();
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/middlewares/auth.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Request, Response, NextFunction } from "express";
import { AuthError } from "@repo/backend/utils/errors";
import { AuthError } from "@repo/backend/errors";
import { jwtVerifyAccessToken } from "@repo/backend/utils/jwt";

export interface AuthenticatedRequest extends Request {
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/middlewares/error.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Request, Response, ErrorRequestHandler, NextFunction } from "express";
import { ReasonPhrases, StatusCodes } from "http-status-codes";
import { GenericError } from "@repo/backend/utils/errors";
import { GenericError } from "@repo/backend/errors";

const errorHandler: ErrorRequestHandler = (
error: unknown,
req: Request,
res: Response,
next: NextFunction,

Check warning on line 9 in apps/backend/src/middlewares/error.ts

View workflow job for this annotation

GitHub Actions / quality-checks / Lint

'next' is defined but never used
) => {
console.error(error);

Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/middlewares/rate-limit.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Request, Response, NextFunction } from "express";
import redis from "@repo/backend/redis";
import { parseTimeSpan, type TimeSpan } from "@repo/backend/utils/time";
import { RateLimitError } from "@repo/backend/utils/errors";
import { RateLimitError } from "@repo/backend/errors";

const rateLimitHandler = ({
endpoint = "global",
Expand Down
5 changes: 3 additions & 2 deletions apps/backend/src/middlewares/validation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Request, Response, NextFunction } from "express";
import { z, ZodError } from "zod";
import { BadRequestError } from "@repo/backend/utils/errors";
import { BadRequestError } from "@repo/backend/errors";

const validateHandler = (schema: z.ZodSchema) => {
return (req: Request, res: Response, next: NextFunction) => {
Expand All @@ -11,7 +11,8 @@ const validateHandler = (schema: z.ZodSchema) => {
if (error instanceof ZodError) {
const errorMessages = error.errors
.map(
(issue: z.ZodIssue) => `${issue.path.join(".")} is ${issue.message}`
(issue: z.ZodIssue) =>
`${issue.path.join(".")} is ${issue.message}`,
)
.join(", ");
throw new BadRequestError(errorMessages);
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/modules/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import twilio from "twilio";
import { eq } from "drizzle-orm";
import { db } from "@repo/database";
import { otps, refreshTokens, users } from "@repo/database/schema";
import { AuthError } from "@repo/backend/utils/errors";
import { AuthError } from "@repo/backend/errors";
import {
jwtSignAccessToken,
jwtSignRefreshToken,
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/modules/chat/chat.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { and, count, desc, eq, exists, notExists } from "drizzle-orm";

Check warning on line 1 in apps/backend/src/modules/chat/chat.service.ts

View workflow job for this annotation

GitHub Actions / quality-checks / Lint

'exists' is defined but never used
import { db } from "@repo/database";
import {
chatParticipants,
Expand All @@ -6,7 +6,7 @@
messageReadReceipts,
messages,
} from "@repo/database/schema";
import { AuthError } from "@repo/backend/utils/errors";
import { AuthError } from "@repo/backend/errors";

const getChats = async (userId: number) => {
const userChats = await db
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/modules/friends/friends.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { and, eq, not, or } from "drizzle-orm";
import { db } from "@repo/database";
import { friends, users } from "@repo/database/schema";
import { BadRequestError } from "@repo/backend/utils/errors";
import { BadRequestError } from "@repo/backend/errors";

const getFriends = async (userId: number) => {
const acceptedFriends = await db
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/modules/user/user.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { and, eq } from "drizzle-orm";
import { db } from "@repo/database";
import { User, users } from "@repo/database/schema";
import { BadRequestError, NotFoundError } from "@repo/backend/utils/errors";
import { BadRequestError, NotFoundError } from "@repo/backend/errors";

const getUser = async (userId: number) => {
const me = await db.query.users.findFirst({
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import express, { type Express } from "express";
import morgan from "morgan";
import cors from "cors";
import cookieParser from "cookie-parser";
import { NotFoundError } from "@repo/backend/utils/errors";
import { NotFoundError } from "@repo/backend/errors";
import rootRouter from "@repo/backend/modules";
import errorHandler from "@repo/backend/middlewares/error";
import rateLimitHandler from "@repo/backend/middlewares/rate-limit";
Expand Down
Loading