diff options
| author | bob <bcz@cs.brown.edu> | 2019-05-20 15:46:21 -0400 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-05-20 15:46:21 -0400 |
| commit | e02e8bee7ee36490b83edb0a416978216b0f4a17 (patch) | |
| tree | 06852226aee609917d1a7ab8ab8c2de86947225d /src/client/views/SearchBox.tsx | |
| parent | f4d80b5c707b3bbcd9dde34582de2b804fbb6f36 (diff) | |
hooking up image data url stuff.
Diffstat (limited to 'src/client/views/SearchBox.tsx')
| -rw-r--r-- | src/client/views/SearchBox.tsx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/client/views/SearchBox.tsx b/src/client/views/SearchBox.tsx index 8efd8d266..0ec1a6758 100644 --- a/src/client/views/SearchBox.tsx +++ b/src/client/views/SearchBox.tsx @@ -20,6 +20,7 @@ import { Id } from '../../new_fields/FieldSymbols'; import { DocumentManager } from '../util/DocumentManager'; import { SetupDrag } from '../util/DragManager'; import { Docs } from '../documents/Documents'; +import { RouteStore } from '../../server/RouteStore'; library.add(faSearch); library.add(faObjectGroup); @@ -70,6 +71,22 @@ export class SearchBox extends React.Component { } return docs; } + public static async convertDataUri(imageUri: string, returnedFilename: string) { + try { + let posting = DocServer.prepend(RouteStore.dataUriToImage); + const returnedUri = await rp.post(posting, { + body: { + uri: imageUri, + name: returnedFilename + }, + json: true, + }); + return returnedUri; + + } catch (e) { + console.log(e); + } + } @action handleClickFilter = (e: Event): void => { |
