DataSet - createdBy & createdAt

This commit is contained in:
2022-12-27 22:22:21 +01:00
parent 360928b928
commit 149734cb19
10 changed files with 82 additions and 72 deletions

View File

@@ -10,6 +10,7 @@ export class DataSet extends Base {
source?: string;
name?: string;
dataRows: DataRow[] = [];
created?: string;
constructor(data: Partial<DataSet> = {}) {
super();
@@ -34,6 +35,8 @@ export class DataSet extends Base {
modifiedAt: '',
createdBy: '',
modifiedBy: '',
modified: '',
created: ''
});
}
fillForm(form: UntypedFormGroup) {
@@ -92,10 +95,12 @@ export class DataSet extends Base {
})
})
}
static parseGoogleSheet(sheetId: string, _http: HttpClient): Promise<DataRow[]> {
static parseGoogleSheet(sheetId: string, _http: HttpClient): Promise<any> {
return new Promise((resolve, reject) => {
_http.get<DataRow[]>(`${environment.api.url}/datasets/parseGoogleSheet/${sheetId}`,
).pipe(map(data => data.map(x => new DataRow().deserialize(x))))
_http.get<any>(`${environment.api.url}/datasets/parseGoogleSheet/${sheetId}`,
).pipe(map(data => {
data.dataRows = data.dataRows.map((x: any) => new DataRow().deserialize(x))
}))
.subscribe({
next: (data) => {
resolve(data);