From 81a80078a00ef2e9f9dee49e10c652e9317814b8 Mon Sep 17 00:00:00 2001 From: Harshit Date: Sun, 21 Jun 2026 16:30:28 +0530 Subject: [PATCH 1/2] fix(card): Fixes typecheck --- apps/backend/src/routes/cards.ts | 4 ++-- apps/backend/src/services/cardService.ts | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/backend/src/routes/cards.ts b/apps/backend/src/routes/cards.ts index 48132e0e..8b8d6ff2 100644 --- a/apps/backend/src/routes/cards.ts +++ b/apps/backend/src/routes/cards.ts @@ -3,7 +3,7 @@ import { handleDbError } from '../utils/error.util.js'; import { hashIp } from '../utils/refreshToken'; import { createCardSchema ,updateCardSchema, addPlatformLinkSchema} from '../validations/card.validation'; -import type { CardResponse, UpdateCardBody } from '../services/cardService'; +import type { CardResponse, UpdateCardBody, UpdatedCardResponse } from '../services/cardService'; import type { Card } from '@devcard/shared/src/types.js'; import type { CardVisibility } from '@prisma/client'; import type { FastifyInstance, FastifyRequest, FastifyReply } from 'fastify'; @@ -99,7 +99,7 @@ export async function cardRoutes(app: FastifyInstance): Promise { // ─── Update Card ─── - app.put('/:id', async (request: FastifyRequest<{ Params: CardParams; Body: UpdateCardBody }>, reply: FastifyReply): Promise => { + app.put('/:id', async (request: FastifyRequest<{ Params: CardParams; Body: UpdateCardBody }>, reply: FastifyReply): Promise => { const userId = request.user.id; const { id } = request.params; diff --git a/apps/backend/src/services/cardService.ts b/apps/backend/src/services/cardService.ts index bbd776dc..e1ecb6ef 100644 --- a/apps/backend/src/services/cardService.ts +++ b/apps/backend/src/services/cardService.ts @@ -10,6 +10,11 @@ type CardLinkResponse = { platformLink: unknown }; type RawCard = { id: string; title: string; isDefault: boolean; cardLinks: CardLinkResponse[] }; export type CardResponse = { id: string; title: string; isDefault: boolean; links: unknown[] }; +export type updateCardResponse = { + id: string; + title: string; + isDefault:boolean; +} export interface UpdateCardBody{ title?:string; From cb87040c47243856ae7d78e2c3598c42c5c9c643 Mon Sep 17 00:00:00 2001 From: Harshit Date: Sun, 21 Jun 2026 16:33:24 +0530 Subject: [PATCH 2/2] fix: Updated the type name --- apps/backend/src/services/cardService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/backend/src/services/cardService.ts b/apps/backend/src/services/cardService.ts index e1ecb6ef..4c83d5b2 100644 --- a/apps/backend/src/services/cardService.ts +++ b/apps/backend/src/services/cardService.ts @@ -10,7 +10,7 @@ type CardLinkResponse = { platformLink: unknown }; type RawCard = { id: string; title: string; isDefault: boolean; cardLinks: CardLinkResponse[] }; export type CardResponse = { id: string; title: string; isDefault: boolean; links: unknown[] }; -export type updateCardResponse = { +export type UpdatedCardResponse = { id: string; title: string; isDefault:boolean;