Add comments

This commit is contained in:
Ramon Wenger 2019-12-09 15:44:50 +01:00
parent d400b2f61c
commit 84bcfdc7cf
1 changed files with 2 additions and 2 deletions

View File

@ -9,7 +9,7 @@ export const constructNoteMutation = (n) => {
let update = () => {
};
if (n.contentBlock) {
if (n.contentBlock) { // has a content block, so it is a content block bookmark
update = (store, {data: {addNote: {note}}}) => {
const query = CONTENT_BLOCK_QUERY;
const variables = {id: n.contentBlock};
@ -38,7 +38,7 @@ export const constructNoteMutation = (n) => {
variables
});
};
} else {
} else { // it's a chapter bookmark or a module bookmark
update = (store, {data: {addNote: {note}}}) => {
const type = getBlockType(n.parent) === 'ChapterNode' ? 'chapter' : 'module';
const query = type === 'chapter' ? CHAPTER_QUERY : MODULE_QUERY;