Merged PR 311: Task一覧取得でstatus未設定の場合に0件となってしまうので対応

## 概要
[Task2367: Task一覧取得でstatus未設定の場合に0件となってしまうので対応](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/2367)

- タイトルの通り

## レビューポイント
- 修正箇所はこれでよいか

## UIの変更
- https://ndstokyo.sharepoint.com/:f:/r/sites/Piranha/Shared%20Documents/General/OMDS/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88/Task2367?csf=1&web=1&e=u7lReD

## 動作確認状況
- ローカルで確認、develop環境で確認など

## 補足
- 相談、参考資料などがあれば
This commit is contained in:
saito.k 2023-08-07 08:59:38 +00:00
parent b59a5df44c
commit d70b471d55
2 changed files with 8 additions and 5 deletions

View File

@ -98,7 +98,8 @@ export class TasksController {
decodedToken,
offset,
limit,
status?.split(',') ?? [],
// statusが指定されていない場合は全てのステータスを取得する
status?.split(','),
paramName,
direction,
);

View File

@ -51,7 +51,7 @@ export class TasksService {
accessToken: AccessToken,
offset: number,
limit: number,
status: string[],
status?: string[],
paramName?: TaskListSortableAttribute,
direction?: SortDirection,
): Promise<{ tasks: Task[]; total: number }> {
@ -66,6 +66,8 @@ export class TasksService {
// パラメータが省略された場合のデフォルト値: 保存するソート条件の値の初期値と揃える
const defaultParamName: TaskListSortableAttribute = 'JOB_NUMBER';
const defaultDirection: SortDirection = 'ASC';
// statusが省略された場合のデフォルト値: 全てのステータス
const defaultStatus = Object.values(TASK_STATUS);
try {
const { account_id, author_id } =
@ -78,7 +80,7 @@ export class TasksService {
limit,
paramName ?? defaultParamName,
direction ?? defaultDirection,
status,
status ?? defaultStatus,
);
// B2Cからユーザー名を取得する
@ -101,7 +103,7 @@ export class TasksService {
limit,
paramName ?? defaultParamName,
direction ?? defaultDirection,
status,
status ?? defaultStatus,
);
// B2Cからユーザー名を取得する
@ -122,7 +124,7 @@ export class TasksService {
limit,
paramName ?? defaultParamName,
direction ?? defaultDirection,
status,
status ?? defaultStatus,
);
// B2Cからユーザー名を取得する
const b2cUsers = await this.getB2cUsers(