Skip to content

Commit

Permalink
Merge pull request #753 from twin-te/hotfix/course-editing-submit-but…
Browse files Browse the repository at this point in the history
…ton-activating

授業編集時に空文字が担当教員欄に入りバリデーションエラーになるバグを修正
  • Loading branch information
HosokawaR authored Apr 17, 2024
2 parents 00f91f9 + 49bf341 commit 1bce608
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 1bce608

Please sign in to comment.