change export directory
This commit is contained in:
@@ -95,12 +95,10 @@ export class DataSet extends Base {
|
||||
})
|
||||
})
|
||||
}
|
||||
static parseGoogleSheet(sheetId: string, _http: HttpClient): Promise<any> {
|
||||
static parseGoogleSheet(sheetId: string, _http: HttpClient): Promise<DataSet> {
|
||||
return new Promise((resolve, reject) => {
|
||||
_http.get<any>(`${environment.api.url}/datasets/parseGoogleSheet/${sheetId}`,
|
||||
).pipe(map(data => {
|
||||
data.dataRows = data.dataRows.map((x: any) => new DataRow().deserialize(x))
|
||||
}))
|
||||
_http.get<DataSet>(`${environment.api.url}/datasets/parseGoogleSheet/${sheetId}`,
|
||||
).pipe(map(data => new DataSet().deserialize(data)))
|
||||
.subscribe({
|
||||
next: (data) => {
|
||||
resolve(data);
|
||||
|
||||
@@ -65,7 +65,8 @@ export class DataSetEditComponent implements OnInit {
|
||||
}
|
||||
async parseGoogleSheet() {
|
||||
const id = this.form.get('sheetId')?.value;
|
||||
this.document.dataRows = await DataSet.parseGoogleSheet(id, this.http$);
|
||||
this.document = await DataSet.parseGoogleSheet(id, this.http$);
|
||||
this.document.fillForm(this.form);
|
||||
this.dataSource = new MatTableDataSource(this.document.dataRows);
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace WebAPI.Exports
|
||||
Google.Apis.Drive.v3.Data.File body = new Google.Apis.Drive.v3.Data.File();
|
||||
body.Name = $"export-{DateTime.Now}";
|
||||
body.MimeType = "application/vnd.google-apps.spreadsheet";
|
||||
body.Parents = new List<string> { "1Sar-9ux6GWlXKZiD-l1Mfh1gdsxZif3j" };
|
||||
body.Parents = new List<string> { "1c5GBQmsIoj6a9L-JYFTaLEZ3EfkbQHPt" };
|
||||
CreateRequest request = googleDriveHelper.Service.Files.Create(body);
|
||||
var file = request.Execute();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user