回答編集履歴
2
リストなのにfind でした。 filterに変更しました。
answer
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
const updatedLanguage = {id: updateStateId, level: value}
|
7
7
|
|
8
8
|
// 更新したくない Language のリストを生成します。
|
9
|
-
const notUpdateLanguage = state.data.language.
|
9
|
+
const notUpdateLanguage = state.data.language.filter((lg) => {
|
10
10
|
// ここ、st.language.id になっていましたが、find が language に紐づいているので、こうじゃないですか?
|
11
11
|
return lg.id !== updateStateId;
|
12
12
|
});
|
1
更新したくないリストなのに === のままでした。 !== に変更しました。
answer
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
// 更新したくない Language のリストを生成します。
|
9
9
|
const notUpdateLanguage = state.data.language.find((lg) => {
|
10
10
|
// ここ、st.language.id になっていましたが、find が language に紐づいているので、こうじゃないですか?
|
11
|
-
return lg.id ==
|
11
|
+
return lg.id !== updateStateId;
|
12
12
|
});
|
13
13
|
|
14
14
|
// 更新したくないものと更新したものをまとめます。
|