提交 d0516216 编写于 作者: F Fatih Acet

IssueNotesRefactor: Support legacy multiple notes for individual_note: true case.

上级 479670df
......@@ -70,7 +70,22 @@ export default {
Object.assign(state, { userData: data });
},
[types.SET_INITIAL_NOTES](state, notesData) {
Object.assign(state, { notes: notesData });
const notes = [];
notesData.forEach((note) => {
// To support legacy notes, should be very rare case.
if (note.individual_note && note.notes.length > 1) {
note.notes.forEach((n) => {
const nn = Object.assign({}, note);
nn.notes = [n]; // override notes array to only have one item to mimick individual_note
notes.push(nn);
});
} else {
notes.push(note);
}
});
Object.assign(state, { notes });
},
[types.SET_LAST_FETCHED_AT](state, fetchedAt) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册