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

N21-1397 Generate API #2885

Merged
merged 7 commits into from
Nov 3, 2023
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
26 changes: 13 additions & 13 deletions src/serverApi/v3/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8953,15 +8953,15 @@ export const GroupApiAxiosParamCreator = function (configuration?: Configuration
return {
/**
*
* @summary Get a list of classes and groups of type class for the current users school.
* @summary Get a list of classes and groups of type class for the current user.
* @param {number} [skip] Number of elements (not pages) to be skipped
* @param {number} [limit] Page limit, defaults to 10.
* @param {'asc' | 'desc'} [sortOrder]
* @param {'name' | 'externalSourceName'} [sortBy]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
groupControllerFindClassesForSchool: async (skip?: number, limit?: number, sortOrder?: 'asc' | 'desc', sortBy?: 'name' | 'externalSourceName', options: any = {}): Promise<RequestArgs> => {
groupControllerFindClasses: async (skip?: number, limit?: number, sortOrder?: 'asc' | 'desc', sortBy?: 'name' | 'externalSourceName', options: any = {}): Promise<RequestArgs> => {
const localVarPath = `/groups/class`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
Expand Down Expand Up @@ -9055,16 +9055,16 @@ export const GroupApiFp = function(configuration?: Configuration) {
return {
/**
*
* @summary Get a list of classes and groups of type class for the current users school.
* @summary Get a list of classes and groups of type class for the current user.
* @param {number} [skip] Number of elements (not pages) to be skipped
* @param {number} [limit] Page limit, defaults to 10.
* @param {'asc' | 'desc'} [sortOrder]
* @param {'name' | 'externalSourceName'} [sortBy]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async groupControllerFindClassesForSchool(skip?: number, limit?: number, sortOrder?: 'asc' | 'desc', sortBy?: 'name' | 'externalSourceName', options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ClassInfoSearchListResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.groupControllerFindClassesForSchool(skip, limit, sortOrder, sortBy, options);
async groupControllerFindClasses(skip?: number, limit?: number, sortOrder?: 'asc' | 'desc', sortBy?: 'name' | 'externalSourceName', options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ClassInfoSearchListResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.groupControllerFindClasses(skip, limit, sortOrder, sortBy, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
Expand All @@ -9090,16 +9090,16 @@ export const GroupApiFactory = function (configuration?: Configuration, basePath
return {
/**
*
* @summary Get a list of classes and groups of type class for the current users school.
* @summary Get a list of classes and groups of type class for the current user.
* @param {number} [skip] Number of elements (not pages) to be skipped
* @param {number} [limit] Page limit, defaults to 10.
* @param {'asc' | 'desc'} [sortOrder]
* @param {'name' | 'externalSourceName'} [sortBy]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
groupControllerFindClassesForSchool(skip?: number, limit?: number, sortOrder?: 'asc' | 'desc', sortBy?: 'name' | 'externalSourceName', options?: any): AxiosPromise<ClassInfoSearchListResponse> {
return localVarFp.groupControllerFindClassesForSchool(skip, limit, sortOrder, sortBy, options).then((request) => request(axios, basePath));
groupControllerFindClasses(skip?: number, limit?: number, sortOrder?: 'asc' | 'desc', sortBy?: 'name' | 'externalSourceName', options?: any): AxiosPromise<ClassInfoSearchListResponse> {
return localVarFp.groupControllerFindClasses(skip, limit, sortOrder, sortBy, options).then((request) => request(axios, basePath));
},
/**
*
Expand All @@ -9122,7 +9122,7 @@ export const GroupApiFactory = function (configuration?: Configuration, basePath
export interface GroupApiInterface {
/**
*
* @summary Get a list of classes and groups of type class for the current users school.
* @summary Get a list of classes and groups of type class for the current user.
* @param {number} [skip] Number of elements (not pages) to be skipped
* @param {number} [limit] Page limit, defaults to 10.
* @param {'asc' | 'desc'} [sortOrder]
Expand All @@ -9131,7 +9131,7 @@ export interface GroupApiInterface {
* @throws {RequiredError}
* @memberof GroupApiInterface
*/
groupControllerFindClassesForSchool(skip?: number, limit?: number, sortOrder?: 'asc' | 'desc', sortBy?: 'name' | 'externalSourceName', options?: any): AxiosPromise<ClassInfoSearchListResponse>;
groupControllerFindClasses(skip?: number, limit?: number, sortOrder?: 'asc' | 'desc', sortBy?: 'name' | 'externalSourceName', options?: any): AxiosPromise<ClassInfoSearchListResponse>;

/**
*
Expand All @@ -9154,7 +9154,7 @@ export interface GroupApiInterface {
export class GroupApi extends BaseAPI implements GroupApiInterface {
/**
*
* @summary Get a list of classes and groups of type class for the current users school.
* @summary Get a list of classes and groups of type class for the current user.
* @param {number} [skip] Number of elements (not pages) to be skipped
* @param {number} [limit] Page limit, defaults to 10.
* @param {'asc' | 'desc'} [sortOrder]
Expand All @@ -9163,8 +9163,8 @@ export class GroupApi extends BaseAPI implements GroupApiInterface {
* @throws {RequiredError}
* @memberof GroupApi
*/
public groupControllerFindClassesForSchool(skip?: number, limit?: number, sortOrder?: 'asc' | 'desc', sortBy?: 'name' | 'externalSourceName', options?: any) {
return GroupApiFp(this.configuration).groupControllerFindClassesForSchool(skip, limit, sortOrder, sortBy, options).then((request) => request(this.axios, this.basePath));
public groupControllerFindClasses(skip?: number, limit?: number, sortOrder?: 'asc' | 'desc', sortBy?: 'name' | 'externalSourceName', options?: any) {
return GroupApiFp(this.configuration).groupControllerFindClasses(skip, limit, sortOrder, sortBy, options).then((request) => request(this.axios, this.basePath));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/store/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default class GroupModule extends VuexModule {
: undefined;

const response: AxiosResponse<ClassInfoSearchListResponse> =
await this.groupApi.groupControllerFindClassesForSchool(
await this.groupApi.groupControllerFindClasses(
this.pagination.skip,
this.pagination.limit,
this.getSortOrder,
Expand Down
10 changes: 4 additions & 6 deletions src/store/group.unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ describe("GroupModule", () => {
limit: pagination.limit,
});

apiMock.groupControllerFindClassesForSchool.mockResolvedValue(
apiMock.groupControllerFindClasses.mockResolvedValue(
mockApiResponse({ data: response })
);

Expand All @@ -217,9 +217,7 @@ describe("GroupModule", () => {

await module.loadClassesForSchool();

expect(
apiMock.groupControllerFindClassesForSchool
).toHaveBeenCalledWith(
expect(apiMock.groupControllerFindClasses).toHaveBeenCalledWith(
pagination.skip,
pagination.limit,
sortOrder,
Expand All @@ -242,7 +240,7 @@ describe("GroupModule", () => {
const error = axiosErrorFactory.build();
const apiError = mapAxiosErrorToResponseError(error);

apiMock.groupControllerFindClassesForSchool.mockRejectedValue(error);
apiMock.groupControllerFindClasses.mockRejectedValue(error);

return {
apiError,
Expand Down Expand Up @@ -288,7 +286,7 @@ describe("GroupModule", () => {

await module.deleteClass(class1.id);

expect(apiMock.groupControllerFindClassesForSchool).toHaveBeenCalled();
expect(apiMock.groupControllerFindClasses).toHaveBeenCalled();
});
});

Expand Down
Loading