@unchainedshop/cockpit-api 1.0.29 → 1.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.js CHANGED
@@ -113,7 +113,7 @@ const handleErrorAndLog = (e) => {
113
113
  return null;
114
114
  };
115
115
  export const CockpitAPI = async (tenant, cockpitOptions) => {
116
- if (!process.env.COCKPIT_GRAPHQL_ENDPOINT || !cockpitOptions?.endpoint)
116
+ if (!process.env.COCKPIT_GRAPHQL_ENDPOINT && !cockpitOptions?.endpoint)
117
117
  throw Error("COCKPIT_GRAPHQL_ENDPOINT is not set");
118
118
  const cockpitEndPOint = cockpitOptions.endpoint || process.env.COCKPIT_GRAPHQL_ENDPOINT;
119
119
  const buildUrl = (path, { locale = "de", queryParams = {} } = {}) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unchainedshop/cockpit-api",
3
- "version": "1.0.29",
3
+ "version": "1.0.30",
4
4
  "description": "A package to interact with the Cockpit CMS API, including functionalities to handle GraphQL requests and various CMS content manipulations.",
5
5
  "main": "dist/index.js",
6
6
  "homepage": "https://unchained.shop",
package/src/api.ts CHANGED
@@ -135,7 +135,7 @@ const handleErrorAndLog = (e: Error) => {
135
135
  };
136
136
 
137
137
  export const CockpitAPI = async (tenant?: string, cockpitOptions?: CockpitAPIOptions) => {
138
- if (!process.env.COCKPIT_GRAPHQL_ENDPOINT || !cockpitOptions?.endpoint) throw Error("COCKPIT_GRAPHQL_ENDPOINT is not set")
138
+ if (!process.env.COCKPIT_GRAPHQL_ENDPOINT && !cockpitOptions?.endpoint) throw Error("COCKPIT_GRAPHQL_ENDPOINT is not set")
139
139
  const cockpitEndPOint = cockpitOptions.endpoint || process.env.COCKPIT_GRAPHQL_ENDPOINT;
140
140
 
141
141