digirati-annotation-redux
Advanced tools
Comparing version 0.1.6 to 0.1.9
@@ -7,3 +7,3 @@ export var ELUCIDATE_SET_SERVER = 'ELUCIDATE_SET_SERVER'; | ||
import { getServer } from '../query/elucidateQuery'; | ||
import { getServer, getCollectionId } from '../query/elucidateQuery'; | ||
import { createElucidateCollection, sendAnnotationToServer } from '../lib/elucidate'; | ||
@@ -39,4 +39,4 @@ | ||
dispatch({ type: ELUCIDATE_SEND_ANNOTATION, payload: { annotation: { body: body, target: target } } }); | ||
var elucidateServer = getServer(state()); | ||
return sendAnnotationToServer(elucidateServer, body, target).then(function (annotation) { | ||
var collection = getCollectionId(state()); | ||
return sendAnnotationToServer(collection, body, target).then(function (annotation) { | ||
return dispatch(addAnnotation(annotation)); | ||
@@ -43,0 +43,0 @@ }); |
@@ -11,2 +11,6 @@ export function getServer(state) { | ||
return state.elucidate.pendingAnnotations > 0; | ||
} | ||
export function getCollectionId(state) { | ||
return state.elucidate.collection.id; | ||
} |
@@ -49,4 +49,4 @@ 'use strict'; | ||
dispatch({ type: ELUCIDATE_SEND_ANNOTATION, payload: { annotation: { body: body, target: target } } }); | ||
var elucidateServer = (0, _elucidateQuery.getServer)(state()); | ||
return (0, _elucidate.sendAnnotationToServer)(elucidateServer, body, target).then(function (annotation) { | ||
var collection = (0, _elucidateQuery.getCollectionId)(state()); | ||
return (0, _elucidate.sendAnnotationToServer)(collection, body, target).then(function (annotation) { | ||
return dispatch(addAnnotation(annotation)); | ||
@@ -53,0 +53,0 @@ }); |
@@ -7,2 +7,3 @@ "use strict"; | ||
exports.isSendingAnnotations = isSendingAnnotations; | ||
exports.getCollectionId = getCollectionId; | ||
function getServer(state) { | ||
@@ -18,2 +19,6 @@ return state.elucidate.server; | ||
return state.elucidate.pendingAnnotations > 0; | ||
} | ||
function getCollectionId(state) { | ||
return state.elucidate.collection.id; | ||
} |
{ | ||
"name": "digirati-annotation-redux", | ||
"version": "0.1.6", | ||
"version": "0.1.9", | ||
"description": "Describe annotation-redux here", | ||
@@ -5,0 +5,0 @@ "main": "es/index.js", |
51307
1233