From 1a04469326547d706879e90d0ebce3d4adf548e6 Mon Sep 17 00:00:00 2001 From: Danny Rorabaugh Date: Tue, 9 Jan 2024 10:55:23 -0500 Subject: [PATCH] Fix speaker controller path --- Backend/Controllers/SpeakerController.cs | 2 +- src/api/api/speaker-api.ts | 35 +++++++++++------------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/Backend/Controllers/SpeakerController.cs b/Backend/Controllers/SpeakerController.cs index 4e83d3a0d2..5b99f812a3 100644 --- a/Backend/Controllers/SpeakerController.cs +++ b/Backend/Controllers/SpeakerController.cs @@ -81,7 +81,7 @@ public async Task GetSpeaker(string projectId, string speakerId) /// Creates a for the specified projectId /// Id of created Speaker - [HttpGet("/create/{name}", Name = "CreateSpeaker")] + [HttpGet("create/{name}", Name = "CreateSpeaker")] [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(string))] public async Task CreateSpeaker(string projectId, string name) { diff --git a/src/api/api/speaker-api.ts b/src/api/api/speaker-api.ts index e987fd43eb..c0e30c4e08 100644 --- a/src/api/api/speaker-api.ts +++ b/src/api/api/speaker-api.ts @@ -48,22 +48,23 @@ export const SpeakerApiAxiosParamCreator = function ( return { /** * + * @param {string} projectId * @param {string} name - * @param {string} [projectId] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createSpeaker: async ( + projectId: string, name: string, - projectId?: string, options: any = {} ): Promise => { + // verify required parameter 'projectId' is not null or undefined + assertParamExists("createSpeaker", "projectId", projectId); // verify required parameter 'name' is not null or undefined assertParamExists("createSpeaker", "name", name); - const localVarPath = `/create/{name}`.replace( - `{${"name"}}`, - encodeURIComponent(String(name)) - ); + const localVarPath = `/v1/projects/{projectId}/speakers/create/{name}` + .replace(`{${"projectId"}}`, encodeURIComponent(String(projectId))) + .replace(`{${"name"}}`, encodeURIComponent(String(name))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -79,10 +80,6 @@ export const SpeakerApiAxiosParamCreator = function ( const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - if (projectId !== undefined) { - localVarQueryParameter["projectId"] = projectId; - } - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -526,21 +523,21 @@ export const SpeakerApiFp = function (configuration?: Configuration) { return { /** * + * @param {string} projectId * @param {string} name - * @param {string} [projectId] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createSpeaker( + projectId: string, name: string, - projectId?: string, options?: any ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.createSpeaker( - name, projectId, + name, options ); return createRequestFunction( @@ -780,18 +777,18 @@ export const SpeakerApiFactory = function ( return { /** * + * @param {string} projectId * @param {string} name - * @param {string} [projectId] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createSpeaker( + projectId: string, name: string, - projectId?: string, options?: any ): AxiosPromise { return localVarFp - .createSpeaker(name, projectId, options) + .createSpeaker(projectId, name, options) .then((request) => request(axios, basePath)); }, /** @@ -940,14 +937,14 @@ export interface SpeakerApiCreateSpeakerRequest { * @type {string} * @memberof SpeakerApiCreateSpeaker */ - readonly name: string; + readonly projectId: string; /** * * @type {string} * @memberof SpeakerApiCreateSpeaker */ - readonly projectId?: string; + readonly name: string; } /** @@ -1152,8 +1149,8 @@ export class SpeakerApi extends BaseAPI { ) { return SpeakerApiFp(this.configuration) .createSpeaker( - requestParameters.name, requestParameters.projectId, + requestParameters.name, options ) .then((request) => request(this.axios, this.basePath));