Skip to content

Commit

Permalink
Fix speaker controller path (#2872)
Browse files Browse the repository at this point in the history
  • Loading branch information
imnasnainaec authored Jan 9, 2024
1 parent 45caea0 commit 3dfd736
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Backend/Controllers/SpeakerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public async Task<IActionResult> GetSpeaker(string projectId, string speakerId)

/// <summary> Creates a <see cref="Speaker"/> for the specified projectId </summary>
/// <returns> Id of created Speaker </returns>
[HttpGet("/create/{name}", Name = "CreateSpeaker")]
[HttpGet("create/{name}", Name = "CreateSpeaker")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(string))]
public async Task<IActionResult> CreateSpeaker(string projectId, string name)
{
Expand Down
35 changes: 16 additions & 19 deletions src/api/api/speaker-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<RequestArgs> => {
// 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;
Expand All @@ -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 : {};
Expand Down Expand Up @@ -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<string>
> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createSpeaker(
name,
projectId,
name,
options
);
return createRequestFunction(
Expand Down Expand Up @@ -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<string> {
return localVarFp
.createSpeaker(name, projectId, options)
.createSpeaker(projectId, name, options)
.then((request) => request(axios, basePath));
},
/**
Expand Down Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 3dfd736

Please sign in to comment.