aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/server')
-rw-r--r--src/server/RouteStore.ts2
-rw-r--r--src/server/apis/google/GoogleApiServerUtils.ts6
-rw-r--r--src/server/index.ts4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/server/RouteStore.ts b/src/server/RouteStore.ts
index 5d977006a..014906054 100644
--- a/src/server/RouteStore.ts
+++ b/src/server/RouteStore.ts
@@ -31,6 +31,6 @@ export enum RouteStore {
// APIS
cognitiveServices = "/cognitiveservices",
- googleDocs = "/googleDocs/"
+ googleDocs = "/googleDocs"
} \ No newline at end of file
diff --git a/src/server/apis/google/GoogleApiServerUtils.ts b/src/server/apis/google/GoogleApiServerUtils.ts
index ff027c501..8785cd974 100644
--- a/src/server/apis/google/GoogleApiServerUtils.ts
+++ b/src/server/apis/google/GoogleApiServerUtils.ts
@@ -24,7 +24,7 @@ export namespace GoogleApiServerUtils {
export const parseBuffer = (data: Buffer) => JSON.parse(data.toString());
- export enum Sector {
+ export enum Service {
Documents = "Documents",
Slides = "Slides"
}
@@ -54,10 +54,10 @@ export namespace GoogleApiServerUtils {
let routed: Opt<Endpoint>;
let parameters: EndpointParameters = { auth, version: "v1" };
switch (sector) {
- case Sector.Documents:
+ case Service.Documents:
routed = google.docs(parameters).documents;
break;
- case Sector.Slides:
+ case Service.Slides:
routed = google.slides(parameters).presentations;
break;
}
diff --git a/src/server/index.ts b/src/server/index.ts
index 6aecb875a..0476bf3df 100644
--- a/src/server/index.ts
+++ b/src/server/index.ts
@@ -806,10 +806,10 @@ const EndpointHandlerMap = new Map<GoogleApiServerUtils.Action, GoogleApiServerU
["update", (api, params) => api.batchUpdate(params)],
]);
-app.post(RouteStore.googleDocs + ":sector/:action", (req, res) => {
+app.post(RouteStore.googleDocs + "/:sector/:action", (req, res) => {
let sector = req.params.sector;
let action = req.params.action;
- GoogleApiServerUtils.GetEndpoint(GoogleApiServerUtils.Sector[sector], { credentials, token }).then(endpoint => {
+ GoogleApiServerUtils.GetEndpoint(GoogleApiServerUtils.Service[sector], { credentials, token }).then(endpoint => {
let handler = EndpointHandlerMap.get(action);
if (endpoint && handler) {
let execute = handler(endpoint, req.body).then(