diff options
author | Melissa Zhang <mzhang19096@gmail.com> | 2020-07-06 14:27:34 -0700 |
---|---|---|
committer | Melissa Zhang <mzhang19096@gmail.com> | 2020-07-06 14:27:34 -0700 |
commit | 15adf17efa078464643f8bcfd0f8c0b8afea8424 (patch) | |
tree | 34fb1c900301b4ffee9d7a107e5dde6785cdc3d6 /src/client/apis/hypothesis/HypothesisApiUtils.ts | |
parent | 0e3d35d1139d0edc9247837124c3ffdc0b7201e5 (diff) |
moved some API calls over to Dash
Diffstat (limited to 'src/client/apis/hypothesis/HypothesisApiUtils.ts')
-rw-r--r-- | src/client/apis/hypothesis/HypothesisApiUtils.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/client/apis/hypothesis/HypothesisApiUtils.ts b/src/client/apis/hypothesis/HypothesisApiUtils.ts new file mode 100644 index 000000000..714c9cdaf --- /dev/null +++ b/src/client/apis/hypothesis/HypothesisApiUtils.ts @@ -0,0 +1,13 @@ +export namespace Hypothesis { + export const getAnnotation = async (username: String, searchParam: String) => { + const base = 'https://api.hypothes.is/api/search'; + const request = base + `?user=acct:${username}@hypothes.is&text=${searchParam}`; + console.log("DASH Querying " + request); + const response = await fetch(request); + if (response.ok) { + return response.json(); + } else { + throw new Error('DASH: Error in GET request'); + } + }; +}
\ No newline at end of file |