Skip to content

Commit

Permalink
授業編集時に勝手に空文字が担当教員欄に入りバリデーションエラーになるバグを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
HosokawaR committed Apr 15, 2024
1 parent 00f91f9 commit 49bf341
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/infrastructure/api/converters/instructor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { removeDuplicate } from "~/utils";

export const apiToInstructors = (apiInstructor: string): string[] => {
// [Workaround]
// 担当教員がいない場合に BE は空文字で返すが、FE は空文字をバリデーションエラーとして扱うため、空配列に変換する
if (apiInstructor === "") return [];
return removeDuplicate(
apiInstructor.split(/,|、/).map((instructor) => instructor.trim())
);
Expand Down

0 comments on commit 49bf341

Please sign in to comment.