Browse Source

Improve comment validation

pull/8004/head
Thomas Kaul 2 weeks ago
parent
commit
8bf33dd8dc
  1. 8
      apps/api/src/app/endpoints/mcp/mcp.schemas.ts

8
apps/api/src/app/endpoints/mcp/mcp.schemas.ts

@ -1,5 +1,6 @@
import { DATE_RANGE_PATTERN } from '@ghostfolio/api/dtos/date-range-filter.dto';
import {
COMMENT_MAXIMUM_LENGTH,
DATE_RANGES,
DEFAULT_DATE_RANGE,
MCP_MAX_ACCOUNTS,
@ -122,7 +123,12 @@ export const IMPORT_ACTIVITIES_PARAMETERS = z.object({
.min(1)
.optional()
.describe('The identifier of the account of the activity'),
comment: z.string().optional().describe('The comment of the activity'),
comment: z
.string()
.trim()
.max(COMMENT_MAXIMUM_LENGTH)
.optional()
.describe('The comment of the activity'),
currency: z
.string()
.refine(isValidCurrencyCode)

Loading…
Cancel
Save