aboutsummaryrefslogtreecommitdiff
path: root/src/client/apis
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-11-10 14:56:58 -0500
committerSam Wilkins <samwilkins333@gmail.com>2019-11-10 14:56:58 -0500
commit36ad83493d2bd58dc6fe62df6002789ccc1b06a1 (patch)
treec0d49bd48b8b26f7d46345bf2397dd5ba69c1884 /src/client/apis
parented0657b6b0ca1566af06038e418feda8a680419d (diff)
no more RouteStore
Diffstat (limited to 'src/client/apis')
-rw-r--r--src/client/apis/GoogleAuthenticationManager.tsx5
-rw-r--r--src/client/apis/google_docs/GoogleApiClientUtils.ts7
-rw-r--r--src/client/apis/google_docs/GooglePhotosClientUtils.ts5
3 files changed, 7 insertions, 10 deletions
diff --git a/src/client/apis/GoogleAuthenticationManager.tsx b/src/client/apis/GoogleAuthenticationManager.tsx
index 1ec9d8412..ae77c4b7b 100644
--- a/src/client/apis/GoogleAuthenticationManager.tsx
+++ b/src/client/apis/GoogleAuthenticationManager.tsx
@@ -4,7 +4,6 @@ import * as React from "react";
import MainViewModal from "../views/MainViewModal";
import { Opt } from "../../new_fields/Doc";
import { Networking } from "../Network";
-import { RouteStore } from "../../server/RouteStore";
import "./GoogleAuthenticationManager.scss";
const AuthenticationUrl = "https://accounts.google.com/o/oauth2/v2/auth";
@@ -31,7 +30,7 @@ export default class GoogleAuthenticationManager extends React.Component<{}> {
}
public fetchOrGenerateAccessToken = async () => {
- let response = await Networking.FetchFromServer(RouteStore.readGoogleAccessToken);
+ let response = await Networking.FetchFromServer("/readGoogleAccessToken");
// if this is an authentication url, activate the UI to register the new access token
if (new RegExp(AuthenticationUrl).test(response)) {
this.isOpen = true;
@@ -44,7 +43,7 @@ export default class GoogleAuthenticationManager extends React.Component<{}> {
return;
}
const { access_token, avatar, name } = await Networking.PostToServer(
- RouteStore.writeGoogleAccessToken,
+ "/writeGoogleAccessToken",
{ authenticationCode }
);
runInAction(() => {
diff --git a/src/client/apis/google_docs/GoogleApiClientUtils.ts b/src/client/apis/google_docs/GoogleApiClientUtils.ts
index 183679317..26c7f8d2e 100644
--- a/src/client/apis/google_docs/GoogleApiClientUtils.ts
+++ b/src/client/apis/google_docs/GoogleApiClientUtils.ts
@@ -1,5 +1,4 @@
import { docs_v1, slides_v1 } from "googleapis";
-import { RouteStore } from "../../../server/RouteStore";
import { Opt } from "../../../new_fields/Doc";
import { isArray } from "util";
import { EditorState } from "prosemirror-state";
@@ -77,7 +76,7 @@ export namespace GoogleApiClientUtils {
* @returns the documentId of the newly generated document, or undefined if the creation process fails.
*/
export const create = async (options: CreateOptions): Promise<CreationResult> => {
- const path = `${RouteStore.googleDocs}/Documents/${Actions.Create}`;
+ const path = `/googleDocs/Documents/${Actions.Create}`;
const parameters = {
requestBody: {
title: options.title || `Dash Export (${new Date().toDateString()})`
@@ -154,7 +153,7 @@ export namespace GoogleApiClientUtils {
}
export const retrieve = async (options: RetrieveOptions): Promise<RetrievalResult> => {
- const path = `${RouteStore.googleDocs}/Documents/${Actions.Retrieve}`;
+ const path = `/googleDocs/Documents/${Actions.Retrieve}`;
try {
const parameters = { documentId: options.documentId };
const schema: RetrievalResult = await Networking.PostToServer(path, parameters);
@@ -165,7 +164,7 @@ export namespace GoogleApiClientUtils {
};
export const update = async (options: UpdateOptions): Promise<UpdateResult> => {
- const path = `${RouteStore.googleDocs}/Documents/${Actions.Update}`;
+ const path = `/googleDocs/Documents/${Actions.Update}`;
const parameters = {
documentId: options.documentId,
requestBody: {
diff --git a/src/client/apis/google_docs/GooglePhotosClientUtils.ts b/src/client/apis/google_docs/GooglePhotosClientUtils.ts
index 402fc64b5..bf8897061 100644
--- a/src/client/apis/google_docs/GooglePhotosClientUtils.ts
+++ b/src/client/apis/google_docs/GooglePhotosClientUtils.ts
@@ -1,5 +1,4 @@
import { Utils } from "../../../Utils";
-import { RouteStore } from "../../../server/RouteStore";
import { ImageField } from "../../../new_fields/URLField";
import { Cast, StrCast } from "../../../new_fields/Types";
import { Doc, Opt, DocListCastAsync } from "../../../new_fields/Doc";
@@ -307,7 +306,7 @@ export namespace GooglePhotos {
};
export const WriteMediaItemsToServer = async (body: { mediaItems: any[] }): Promise<UploadInformation[]> => {
- const uploads = await Networking.PostToServer(RouteStore.googlePhotosMediaDownload, body);
+ const uploads = await Networking.PostToServer("/googlePhotosMediaDownload", body);
return uploads;
};
@@ -345,7 +344,7 @@ export namespace GooglePhotos {
media.push({ url, description });
}
if (media.length) {
- const results = await Networking.PostToServer(RouteStore.googlePhotosMediaUpload, { media, album });
+ const results = await Networking.PostToServer("/googlePhotosMediaUpload", { media, album });
return results;
}
};