Skip to content

Commit

Permalink
refactor(api): Refactor custom-widget controller and request validation
Browse files Browse the repository at this point in the history
  • Loading branch information
alepefe committed Nov 8, 2024
1 parent f134bf0 commit 3dec340
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/src/modules/widgets/custom-widgets.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class CustomWidgetsController {
const { userId, id } = params;
const data = await this.customWidgetsService.findCustomWidgetById(
userId,
Number.parseInt(id),
id,
{
authenticatedUser: user,
},
Expand Down
2 changes: 1 addition & 1 deletion shared/contracts/users.contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const usersContract = contract.router({
findCustomWidget: {
method: 'GET',
path: '/users/:userId/widgets/:id',
pathParams: z.object({ userId: z.string().uuid(), id: z.string() }),
pathParams: z.object({ userId: z.string().uuid(), id: z.coerce.number() }),
responses: {
200: contract.type<ApiResponse<CustomWidget>>(),
400: contract.type<JSONAPIError>(),
Expand Down

0 comments on commit 3dec340

Please sign in to comment.