Add comments
This commit is contained in:
parent
d400b2f61c
commit
84bcfdc7cf
|
|
@ -9,7 +9,7 @@ export const constructNoteMutation = (n) => {
|
||||||
let update = () => {
|
let update = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (n.contentBlock) {
|
if (n.contentBlock) { // has a content block, so it is a content block bookmark
|
||||||
update = (store, {data: {addNote: {note}}}) => {
|
update = (store, {data: {addNote: {note}}}) => {
|
||||||
const query = CONTENT_BLOCK_QUERY;
|
const query = CONTENT_BLOCK_QUERY;
|
||||||
const variables = {id: n.contentBlock};
|
const variables = {id: n.contentBlock};
|
||||||
|
|
@ -38,7 +38,7 @@ export const constructNoteMutation = (n) => {
|
||||||
variables
|
variables
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
} else {
|
} else { // it's a chapter bookmark or a module bookmark
|
||||||
update = (store, {data: {addNote: {note}}}) => {
|
update = (store, {data: {addNote: {note}}}) => {
|
||||||
const type = getBlockType(n.parent) === 'ChapterNode' ? 'chapter' : 'module';
|
const type = getBlockType(n.parent) === 'ChapterNode' ? 'chapter' : 'module';
|
||||||
const query = type === 'chapter' ? CHAPTER_QUERY : MODULE_QUERY;
|
const query = type === 'chapter' ? CHAPTER_QUERY : MODULE_QUERY;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue