Ver código fonte

Merge pull request #155 from lsimone/fix/api

fix(api-port): Api port removed from Api request if === 80
Michael Bromley 6 anos atrás
pai
commit
61605c1624
1 arquivos alterados com 7 adições e 1 exclusões
  1. 7 1
      admin-ui/src/app/data/data.module.ts

+ 7 - 1
admin-ui/src/app/data/data.module.ts

@@ -29,7 +29,13 @@ export function createApollo(
 ): ApolloClientOptions<any> {
 ): ApolloClientOptions<any> {
     const { apiHost, apiPort, adminApiPath, tokenMethod } = getAppConfig();
     const { apiHost, apiPort, adminApiPath, tokenMethod } = getAppConfig();
     const host = apiHost === 'auto' ? `${location.protocol}//${location.hostname}` : apiHost;
     const host = apiHost === 'auto' ? `${location.protocol}//${location.hostname}` : apiHost;
-    const port = apiPort === 'auto' ? (location.port === '' ? '' : `:${location.port}`) : `:${apiPort}`;
+    const port = apiPort
+        ? apiPort === 'auto'
+            ? location.port === ''
+                ? ''
+                : `:${location.port}`
+            : `:${apiPort}`
+        : '';
     const apolloCache = new InMemoryCache({
     const apolloCache = new InMemoryCache({
         fragmentMatcher: new IntrospectionFragmentMatcher({
         fragmentMatcher: new IntrospectionFragmentMatcher({
             introspectionQueryResultData: introspectionResult,
             introspectionQueryResultData: introspectionResult,