aboutsummaryrefslogtreecommitdiff
path: root/src/client/apis/hypothesis/HypothesisApiUtils.ts
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-07-10 10:58:38 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-07-10 10:58:38 -0400
commit5e22d4aa9eefb8c92859fc0d1adb508429af2106 (patch)
treeda8b7fa4df9e962578bcf7537ab2edd1f9699c74 /src/client/apis/hypothesis/HypothesisApiUtils.ts
parent1a73ed731ea17c46ac7823577143047097927326 (diff)
not sure if these changes are needed, but I had to add them to get Hypothesis links to work.
Diffstat (limited to 'src/client/apis/hypothesis/HypothesisApiUtils.ts')
-rw-r--r--src/client/apis/hypothesis/HypothesisApiUtils.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/client/apis/hypothesis/HypothesisApiUtils.ts b/src/client/apis/hypothesis/HypothesisApiUtils.ts
index ab83630a9..9cd4b9f80 100644
--- a/src/client/apis/hypothesis/HypothesisApiUtils.ts
+++ b/src/client/apis/hypothesis/HypothesisApiUtils.ts
@@ -40,15 +40,16 @@ export namespace Hypothesis {
};
// Find the most recent placeholder annotation created, and return its ID
- export const getPlaceholderId = async (username: String, searchKeyWord: String) => {
+ export const getPlaceholderId = async (username: string, searchKeyWord: string) => {
const getResponse = await Hypothesis.searchAnnotation(username, searchKeyWord);
const id = getResponse.rows.length > 0 ? getResponse.rows[0].id : undefined;
- return StrCast(id);
+ const uri = getResponse.rows.length > 0 ? getResponse.rows[0].uri : undefined;
+ return id ? { id, uri } : undefined;
};
// Send request to Hypothes.is client to modify a placeholder annotation into a hyperlink to Dash
export const dispatchLinkRequest = async (title: string, url: string, annotationId: string) => {
- const apiKey = "6879-GHmtDG_P2kmWNKM3hcHptEUZX3VMOUePkamCaOrJbSw";
+ const apiKey = "6879-DnMTKjWjnnLPa0Php7f5Ra2kunZ_X0tMRDbTF220_q0";
const oldAnnotation = await fetchAnnotation(annotationId);
const oldText = StrCast(oldAnnotation.text);