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..4c83d5b2 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 UpdatedCardResponse = { + id: string; + title: string; + isDefault:boolean; +} export interface UpdateCardBody{ title?:string;