Skip to content

Commit 7dca217

Browse files
committed
fix: correct export to google frontend bug
1 parent 43fedf2 commit 7dca217

File tree

4 files changed

+15
-127
lines changed

4 files changed

+15
-127
lines changed

HwProj.APIGateway/HwProj.APIGateway.API/TableGenerators/ExcelGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ private static void AddCourseMatesInfo(
214214
var cnt = solutions.Count();
215215
worksheet.Cells[position.Row, position.Column].Value = min;
216216
worksheet.Cells[position.Row, position.Column + 2].Value = cnt;
217-
if (cnt != allSolutions.Count())
217+
if (cnt != allSolutions.Count)
218218
{
219219
worksheet.Cells[position.Row, position.Column + 2].Style.Fill.PatternType =
220220
ExcelFillStyle.Solid;

HwProj.APIGateway/HwProj.APIGateway.API/appsettings.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

hwproj.front/src/api/api.ts

Lines changed: 14 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -4786,47 +4786,6 @@ export const SolutionsApiFetchParamCreator = function (configuration?: Configura
47864786
options: localVarRequestOptions,
47874787
};
47884788
},
4789-
/**
4790-
*
4791-
* @param {number} taskId
4792-
* @param {SolutionViewModel} [model]
4793-
* @param {*} [options] Override http request option.
4794-
* @throws {RequiredError}
4795-
*/
4796-
apiSolutionsRateEmptySolutionByTaskIdPost(taskId: number, model?: SolutionViewModel, options: any = {}): FetchArgs {
4797-
// verify required parameter 'taskId' is not null or undefined
4798-
if (taskId === null || taskId === undefined) {
4799-
throw new RequiredError('taskId','Required parameter taskId was null or undefined when calling apiSolutionsRateEmptySolutionByTaskIdPost.');
4800-
}
4801-
const localVarPath = `/api/Solutions/rateEmptySolution/{taskId}`
4802-
.replace(`{${"taskId"}}`, encodeURIComponent(String(taskId)));
4803-
const localVarUrlObj = url.parse(localVarPath, true);
4804-
const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
4805-
const localVarHeaderParameter = {} as any;
4806-
const localVarQueryParameter = {} as any;
4807-
4808-
// authentication Bearer required
4809-
if (configuration && configuration.apiKey) {
4810-
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
4811-
? configuration.apiKey("Authorization")
4812-
: configuration.apiKey;
4813-
localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
4814-
}
4815-
4816-
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
4817-
4818-
localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
4819-
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
4820-
delete localVarUrlObj.search;
4821-
localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
4822-
const needsSerialization = (<any>"SolutionViewModel" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
4823-
localVarRequestOptions.body = needsSerialization ? JSON.stringify(model || {}) : (model || "");
4824-
4825-
return {
4826-
url: url.format(localVarUrlObj),
4827-
options: localVarRequestOptions,
4828-
};
4829-
},
48304789
/**
48314790
*
48324791
* @param {number} solutionId
@@ -5088,25 +5047,6 @@ export const SolutionsApiFp = function(configuration?: Configuration) {
50885047
});
50895048
};
50905049
},
5091-
/**
5092-
*
5093-
* @param {number} taskId
5094-
* @param {SolutionViewModel} [model]
5095-
* @param {*} [options] Override http request option.
5096-
* @throws {RequiredError}
5097-
*/
5098-
apiSolutionsRateEmptySolutionByTaskIdPost(taskId: number, model?: SolutionViewModel, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Response> {
5099-
const localVarFetchArgs = SolutionsApiFetchParamCreator(configuration).apiSolutionsRateEmptySolutionByTaskIdPost(taskId, model, options);
5100-
return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
5101-
return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
5102-
if (response.status >= 200 && response.status < 300) {
5103-
return response;
5104-
} else {
5105-
throw response;
5106-
}
5107-
});
5108-
};
5109-
},
51105050
/**
51115051
*
51125052
* @param {number} solutionId
@@ -5238,16 +5178,6 @@ export const SolutionsApiFactory = function (configuration?: Configuration, fetc
52385178
apiSolutionsRateEmptySolutionByTaskIdPost(taskId: number, model?: SolutionViewModel, options?: any) {
52395179
return SolutionsApiFp(configuration).apiSolutionsRateEmptySolutionByTaskIdPost(taskId, model, options)(fetch, basePath);
52405180
},
5241-
/**
5242-
*
5243-
* @param {number} taskId
5244-
* @param {SolutionViewModel} [model]
5245-
* @param {*} [options] Override http request option.
5246-
* @throws {RequiredError}
5247-
*/
5248-
apiSolutionsRateEmptySolutionByTaskIdPost(taskId: number, model?: SolutionViewModel, options?: any) {
5249-
return SolutionsApiFp(configuration).apiSolutionsRateEmptySolutionByTaskIdPost(taskId, model, options)(fetch, basePath);
5250-
},
52515181
/**
52525182
*
52535183
* @param {number} solutionId
@@ -5354,18 +5284,6 @@ export class SolutionsApi extends BaseAPI {
53545284
return SolutionsApiFp(this.configuration).apiSolutionsRateEmptySolutionByTaskIdPost(taskId, model, options)(this.fetch, this.basePath);
53555285
}
53565286

5357-
/**
5358-
*
5359-
* @param {number} taskId
5360-
* @param {SolutionViewModel} [model]
5361-
* @param {*} [options] Override http request option.
5362-
* @throws {RequiredError}
5363-
* @memberof SolutionsApi
5364-
*/
5365-
public apiSolutionsRateEmptySolutionByTaskIdPost(taskId: number, model?: SolutionViewModel, options?: any) {
5366-
return SolutionsApiFp(this.configuration).apiSolutionsRateEmptySolutionByTaskIdPost(taskId, model, options)(this.fetch, this.basePath);
5367-
}
5368-
53695287
/**
53705288
*
53715289
* @param {number} solutionId
@@ -5460,13 +5378,12 @@ export const StatisticsApiFetchParamCreator = function (configuration?: Configur
54605378
/**
54615379
*
54625380
* @param {number} [courseId]
5463-
* @param {string} [userId]
54645381
* @param {string} [sheetUrl]
54655382
* @param {string} [sheetName]
54665383
* @param {*} [options] Override http request option.
54675384
* @throws {RequiredError}
54685385
*/
5469-
apiStatisticsExportToSheetGet(courseId?: number, userId?: string, sheetUrl?: string, sheetName?: string, options: any = {}): FetchArgs {
5386+
apiStatisticsExportToSheetGet(courseId?: number, sheetUrl?: string, sheetName?: string, options: any = {}): FetchArgs {
54705387
const localVarPath = `/api/Statistics/exportToSheet`;
54715388
const localVarUrlObj = url.parse(localVarPath, true);
54725389
const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
@@ -5485,10 +5402,6 @@ export const StatisticsApiFetchParamCreator = function (configuration?: Configur
54855402
localVarQueryParameter['courseId'] = courseId;
54865403
}
54875404

5488-
if (userId !== undefined) {
5489-
localVarQueryParameter['userId'] = userId;
5490-
}
5491-
54925405
if (sheetUrl !== undefined) {
54935406
localVarQueryParameter['sheetUrl'] = sheetUrl;
54945407
}
@@ -5510,12 +5423,11 @@ export const StatisticsApiFetchParamCreator = function (configuration?: Configur
55105423
/**
55115424
*
55125425
* @param {number} [courseId]
5513-
* @param {string} [userId]
55145426
* @param {string} [sheetName]
55155427
* @param {*} [options] Override http request option.
55165428
* @throws {RequiredError}
55175429
*/
5518-
apiStatisticsGetFileGet(courseId?: number, userId?: string, sheetName?: string, options: any = {}): FetchArgs {
5430+
apiStatisticsGetFileGet(courseId?: number, sheetName?: string, options: any = {}): FetchArgs {
55195431
const localVarPath = `/api/Statistics/getFile`;
55205432
const localVarUrlObj = url.parse(localVarPath, true);
55215433
const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
@@ -5534,10 +5446,6 @@ export const StatisticsApiFetchParamCreator = function (configuration?: Configur
55345446
localVarQueryParameter['courseId'] = courseId;
55355447
}
55365448

5537-
if (userId !== undefined) {
5538-
localVarQueryParameter['userId'] = userId;
5539-
}
5540-
55415449
if (sheetName !== undefined) {
55425450
localVarQueryParameter['sheetName'] = sheetName;
55435451
}
@@ -5652,14 +5560,13 @@ export const StatisticsApiFp = function(configuration?: Configuration) {
56525560
/**
56535561
*
56545562
* @param {number} [courseId]
5655-
* @param {string} [userId]
56565563
* @param {string} [sheetUrl]
56575564
* @param {string} [sheetName]
56585565
* @param {*} [options] Override http request option.
56595566
* @throws {RequiredError}
56605567
*/
5661-
apiStatisticsExportToSheetGet(courseId?: number, userId?: string, sheetUrl?: string, sheetName?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Result> {
5662-
const localVarFetchArgs = StatisticsApiFetchParamCreator(configuration).apiStatisticsExportToSheetGet(courseId, userId, sheetUrl, sheetName, options);
5568+
apiStatisticsExportToSheetGet(courseId?: number, sheetUrl?: string, sheetName?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Result> {
5569+
const localVarFetchArgs = StatisticsApiFetchParamCreator(configuration).apiStatisticsExportToSheetGet(courseId, sheetUrl, sheetName, options);
56635570
return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
56645571
return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
56655572
if (response.status >= 200 && response.status < 300) {
@@ -5673,13 +5580,12 @@ export const StatisticsApiFp = function(configuration?: Configuration) {
56735580
/**
56745581
*
56755582
* @param {number} [courseId]
5676-
* @param {string} [userId]
56775583
* @param {string} [sheetName]
56785584
* @param {*} [options] Override http request option.
56795585
* @throws {RequiredError}
56805586
*/
5681-
apiStatisticsGetFileGet(courseId?: number, userId?: string, sheetName?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Response> {
5682-
const localVarFetchArgs = StatisticsApiFetchParamCreator(configuration).apiStatisticsGetFileGet(courseId, userId, sheetName, options);
5587+
apiStatisticsGetFileGet(courseId?: number, sheetName?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Response> {
5588+
const localVarFetchArgs = StatisticsApiFetchParamCreator(configuration).apiStatisticsGetFileGet(courseId, sheetName, options);
56835589
return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
56845590
return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
56855591
if (response.status >= 200 && response.status < 300) {
@@ -5747,25 +5653,23 @@ export const StatisticsApiFactory = function (configuration?: Configuration, fet
57475653
/**
57485654
*
57495655
* @param {number} [courseId]
5750-
* @param {string} [userId]
57515656
* @param {string} [sheetUrl]
57525657
* @param {string} [sheetName]
57535658
* @param {*} [options] Override http request option.
57545659
* @throws {RequiredError}
57555660
*/
5756-
apiStatisticsExportToSheetGet(courseId?: number, userId?: string, sheetUrl?: string, sheetName?: string, options?: any) {
5757-
return StatisticsApiFp(configuration).apiStatisticsExportToSheetGet(courseId, userId, sheetUrl, sheetName, options)(fetch, basePath);
5661+
apiStatisticsExportToSheetGet(courseId?: number, sheetUrl?: string, sheetName?: string, options?: any) {
5662+
return StatisticsApiFp(configuration).apiStatisticsExportToSheetGet(courseId, sheetUrl, sheetName, options)(fetch, basePath);
57585663
},
57595664
/**
57605665
*
57615666
* @param {number} [courseId]
5762-
* @param {string} [userId]
57635667
* @param {string} [sheetName]
57645668
* @param {*} [options] Override http request option.
57655669
* @throws {RequiredError}
57665670
*/
5767-
apiStatisticsGetFileGet(courseId?: number, userId?: string, sheetName?: string, options?: any) {
5768-
return StatisticsApiFp(configuration).apiStatisticsGetFileGet(courseId, userId, sheetName, options)(fetch, basePath);
5671+
apiStatisticsGetFileGet(courseId?: number, sheetName?: string, options?: any) {
5672+
return StatisticsApiFp(configuration).apiStatisticsGetFileGet(courseId, sheetName, options)(fetch, basePath);
57695673
},
57705674
/**
57715675
*
@@ -5809,28 +5713,26 @@ export class StatisticsApi extends BaseAPI {
58095713
/**
58105714
*
58115715
* @param {number} [courseId]
5812-
* @param {string} [userId]
58135716
* @param {string} [sheetUrl]
58145717
* @param {string} [sheetName]
58155718
* @param {*} [options] Override http request option.
58165719
* @throws {RequiredError}
58175720
* @memberof StatisticsApi
58185721
*/
5819-
public apiStatisticsExportToSheetGet(courseId?: number, userId?: string, sheetUrl?: string, sheetName?: string, options?: any) {
5820-
return StatisticsApiFp(this.configuration).apiStatisticsExportToSheetGet(courseId, userId, sheetUrl, sheetName, options)(this.fetch, this.basePath);
5722+
public apiStatisticsExportToSheetGet(courseId?: number, sheetUrl?: string, sheetName?: string, options?: any) {
5723+
return StatisticsApiFp(this.configuration).apiStatisticsExportToSheetGet(courseId, sheetUrl, sheetName, options)(this.fetch, this.basePath);
58215724
}
58225725

58235726
/**
58245727
*
58255728
* @param {number} [courseId]
5826-
* @param {string} [userId]
58275729
* @param {string} [sheetName]
58285730
* @param {*} [options] Override http request option.
58295731
* @throws {RequiredError}
58305732
* @memberof StatisticsApi
58315733
*/
5832-
public apiStatisticsGetFileGet(courseId?: number, userId?: string, sheetName?: string, options?: any) {
5833-
return StatisticsApiFp(this.configuration).apiStatisticsGetFileGet(courseId, userId, sheetName, options)(this.fetch, this.basePath);
5734+
public apiStatisticsGetFileGet(courseId?: number, sheetName?: string, options?: any) {
5735+
return StatisticsApiFp(this.configuration).apiStatisticsGetFileGet(courseId, sheetName, options)(this.fetch, this.basePath);
58345736
}
58355737

58365738
/**

hwproj.front/src/components/Solutions/ExportToGoogle.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ const ExportToGoogle: FC<ExportToGoogleProps> = (props: ExportToGoogleProps) =>
101101
setState((prevState) => ({...prevState, loadingStatus: LoadingStatus.Loading}))
102102
const result = await apiSingleton.statisticsApi.apiStatisticsExportToSheetGet(
103103
props.courseId,
104-
props.userId,
105104
url,
106105
getGoogleSheetName())
107106
setState((prevState) =>

0 commit comments

Comments
 (0)