{"record":{"id":"553a8f08a1cccff5","repo":"yikart/AiToEarn","slug":"channelplatformoperationnotsupported-553a8f","errorCode":"ChannelPlatformOperationNotSupported","errorMessage":"ChannelPlatformOperationNotSupported","messagePattern":"ChannelPlatformOperationNotSupported","errorType":"error_code","errorClass":"AppException","httpStatus":null,"severity":"warning","filePath":"project/aitoearn-backend/apps/aitoearn-server/src/core/channels/platforms/pinterest/pinterest-publish-options.provider.ts","lineNumber":31,"sourceCode":"\n@Injectable()\nexport class PinterestPublishOptionsProvider implements PublishOptionSourceProvider {\n  constructor(private readonly pinterestService: PinterestService) {}\n\n  listSources() {\n    return [{\n      field: 'boardId',\n      label: 'Board',\n      description: 'Pinterest board used as the Pin publish target',\n      valueType: PublishOptionValueType.List,\n      requiresAccount: true,\n      createSchema: PinterestBoardCreateSchema,\n    }]\n  }\n\n  async getValues(input: PublishOptionValuesInput): Promise<PublishOptionValuesResult> {\n    if (input.field !== 'boardId') {\n      throw new AppException(ResponseCode.ChannelPlatformOperationNotSupported, {\n        platform: AccountType.Pinterest,\n        field: input.field,\n      })\n    }\n\n    const boards = await this.pinterestService.listBoards(input.credential.accessToken)\n\n    return {\n      field: 'boardId',\n      valueType: PublishOptionValueType.List,\n      items: boards\n        .filter(board => Boolean(board.id))\n        .map(board => this.toItem(board)),\n    }\n  }\n\n  async createValue(input: PublishOptionCreateInput): Promise<PublishOptionCreateResult> {\n    if (input.field !== 'boardId') {","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/yikart/AiToEarn/blob/d3aa8bea5b146a8675607cf0144d891aad3e9683/project/aitoearn-backend/apps/aitoearn-server/src/core/channels/platforms/pinterest/pinterest-publish-options.provider.ts#L13-L49","documentation":"ChannelPlatformOperationNotSupported is thrown by PinterestPublishOptionsProvider.getValues when asked for dynamic option values of a field other than 'boardId'. Pinterest only supports boards as a dynamic publish option, so any other field has no value-listing operation.","triggerScenarios":"Calling getValues({ field: '<anything-other-than-boardId>', credential, ... }) — e.g. a client UI requesting values for a field the Pinterest platform never registered as dynamic.","commonSituations":"Frontend publishing dialog built generically across platforms requesting values for a stale or platform-mismatched field name; schema changed so field key no longer 'boardId'.","solutions":["Only call getValues with field === 'boardId' for Pinterest channels","Fix the client to map fields from the provider's getOptions() schema instead of hardcoding field names","If a new dynamic field is needed, extend the provider to handle it explicitly"],"exampleFix":"// before\nawait provider.getValues({ field: 'boardName', credential }) // throws\n// after\nawait provider.getValues({ field: 'boardId', credential })","handlingStrategy":"validation","validationCode":"const SUPPORTED_PINTEREST_VALUE_FIELDS = ['boardId']\nif (!SUPPORTED_PINTEREST_VALUE_FIELDS.includes(input.field)) {\n  throw new Error(`Pinterest supports dynamic values only for boardId, got ${input.field}`)\n}\nawait provider.getValues(input)","typeGuard":"function isPinterestValueField(f: string): f is 'boardId' {\n  return f === 'boardId'\n}","tryCatchPattern":"try {\n  values = await provider.getValues(input)\n} catch (e) {\n  if (e instanceof AppException && e.code === ResponseCode.ChannelPlatformOperationNotSupported) {\n    values = [] // no dynamic values for this field on Pinterest\n  } else throw e\n}","preventionTips":["Derive field names from getOptions()/schema instead of hardcoding","Branch per-platform before calling dynamic value APIs","Only offer board pickers on Pinterest channels in the UI"],"tags":["pinterest","publish-options","unsupported-operation","api-misuse"],"backgroundTag":"platform-operation-not-supported","analyzedSha":"d3aa8bea5b146a8675607cf0144d891aad3e9683","analyzedAt":"2026-08-31T14:19:24.185Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}