@unchainedshop/cockpit-api 1.0.30 → 1.0.31

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/api.ts +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unchainedshop/cockpit-api",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
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
@@ -136,7 +136,7 @@ const handleErrorAndLog = (e: Error) => {
136
136
 
137
137
  export const CockpitAPI = async (tenant?: string, cockpitOptions?: CockpitAPIOptions) => {
138
138
  if (!process.env.COCKPIT_GRAPHQL_ENDPOINT && !cockpitOptions?.endpoint) throw Error("COCKPIT_GRAPHQL_ENDPOINT is not set")
139
- const cockpitEndPOint = cockpitOptions.endpoint || process.env.COCKPIT_GRAPHQL_ENDPOINT;
139
+ const cockpitEndpoint = cockpitOptions?.endpoint || process.env.COCKPIT_GRAPHQL_ENDPOINT;
140
140
 
141
141
 
142
142
  const buildUrl = (path: string, { locale = "de", queryParams = {} } = {}) => {
@@ -191,7 +191,7 @@ export const CockpitAPI = async (tenant?: string, cockpitOptions?: CockpitAPIOpt
191
191
  return {
192
192
  async graphQL(document: any, variables: any) {
193
193
  const query = print(document);
194
- const cockpitEndpointUrl = new URL(cockpitEndPOint);
194
+ const cockpitEndpointUrl = new URL(cockpitEndpoint);
195
195
  if (tenant) {
196
196
  cockpitEndpointUrl.pathname = `/:${tenant}${cockpitEndpointUrl.pathname}`;
197
197
  }