From a127549b0a1d0b13ff61b180dc7773304a853a54 Mon Sep 17 00:00:00 2001 From: Jeremy Moseley Date: Thu, 12 Sep 2024 13:00:27 -0700 Subject: [PATCH] fix: use camel case route. (#47) --- package-lock.json | 4 ++-- src/content.ts | 8 +++----- src/org.ts | 8 ++++---- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 18ebe81..7de4e2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@cortexclick/cortex", - "version": "0.0.10", + "version": "0.0.12", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@cortexclick/cortex", - "version": "0.0.10", + "version": "0.0.12", "license": "Apache-2.0", "dependencies": { "form-data": "^4.0.0" diff --git a/src/content.ts b/src/content.ts index f2d5c48..24f2143 100644 --- a/src/content.ts +++ b/src/content.ts @@ -1,6 +1,6 @@ -import { Cortex } from "./cortex"; -import { CortexApiClient } from "./api-client"; import { Readable } from "stream"; +import { CortexApiClient } from "./api-client"; +import { Cortex } from "./cortex"; import { processStream } from "./utils/streaming"; export type ContentCommandType = @@ -432,9 +432,7 @@ export class Content { } async getPublishTargets() { - const res = await this.apiClient.GET( - `/content/${this._id}/publish-targets`, - ); + const res = await this.apiClient.GET(`/content/${this._id}/publishTargets`); if (res.status !== 200) { throw new Error( diff --git a/src/org.ts b/src/org.ts index f976c65..726dcdb 100644 --- a/src/org.ts +++ b/src/org.ts @@ -32,7 +32,7 @@ export class OrgConfig { } static async get(client: CortexApiClient): Promise { - const res = await client.GET("/org-config"); + const res = await client.GET("/orgConfig"); if (res.status !== 200) { throw new Error(`Failed to configure cortex: ${res.statusText}`); } @@ -50,12 +50,12 @@ export class OrgConfig { client: CortexApiClient, config: OrgConfigOpts, ): Promise { - const getRes = await client.GET("/org-config"); + const getRes = await client.GET("/orgConfig"); let res: Response; if (getRes.status !== 200) { - res = await client.POST("/org-config", config); + res = await client.POST("/orgConfig", config); } else { - res = await client.PUT("/org-config", config); + res = await client.PUT("/orgConfig", config); } if (res.status > 201) {