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

Loading…
Cancel
Save