Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SpeakerController] Fix CreateSpeaker api path #2872

Merged
merged 2 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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