File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { handleDbError } from '../utils/error.util.js';
33import { hashIp } from '../utils/refreshToken' ;
44import { createCardSchema , updateCardSchema , addPlatformLinkSchema } from '../validations/card.validation' ;
55
6- import type { CardResponse , UpdateCardBody } from '../services/cardService' ;
6+ import type { CardResponse , UpdateCardBody , UpdatedCardResponse } from '../services/cardService' ;
77import type { Card } from '@devcard/shared/src/types.js' ;
88import type { CardVisibility } from '@prisma/client' ;
99import type { FastifyInstance , FastifyRequest , FastifyReply } from 'fastify' ;
@@ -99,7 +99,7 @@ export async function cardRoutes(app: FastifyInstance): Promise<void> {
9999
100100 // ─── Update Card ───
101101
102- app . put ( '/:id' , async ( request : FastifyRequest < { Params : CardParams ; Body : UpdateCardBody } > , reply : FastifyReply ) : Promise < CardResponse > => {
102+ app . put ( '/:id' , async ( request : FastifyRequest < { Params : CardParams ; Body : UpdateCardBody } > , reply : FastifyReply ) : Promise < UpdatedCardResponse > => {
103103 const userId = request . user . id ;
104104 const { id } = request . params ;
105105
Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ type CardLinkResponse = { platformLink: unknown };
1010type RawCard = { id : string ; title : string ; isDefault : boolean ; cardLinks : CardLinkResponse [ ] } ;
1111export type CardResponse = { id : string ; title : string ; isDefault : boolean ; links : unknown [ ] } ;
1212
13+ export type UpdatedCardResponse = {
14+ id : string ;
15+ title : string ;
16+ isDefault :boolean ;
17+ }
1318
1419export interface UpdateCardBody {
1520 title ?:string ;
You can’t perform that action at this time.
0 commit comments