問題タブ [class-validator]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
nestjs - NestJS: @Query オブジェクトで配列を変換する方法
私はNestJSが初めてで、クエリパラメーターからフィルターDTOを入力しようとしています。
ここに私が持っているものがあります:
クエリ:
ローカルホスト:3000/api/checklists?stations=114630,114666,114667,114668
コントローラ
DTO
これにより、クラスバリデーターは文句を言いませんが、フィルターオブジェクトでステーションは実際には配列ではなく、単一の文字列のままです。
検証パイプ内で配列に変換したい。どうすればそれを達成できますか?