Remove one-shot data migration tool (jumps.json + importJumps)
This commit is contained in:
@@ -26,8 +26,6 @@ import { JumpAddDialogComponent } from '@components/logbook/dialogs';
|
||||
import { MenuItems, JumpTableComponent } from '@components/shared';
|
||||
import { Errors, Jump, JumpFile, JumpFileType, JumpListConfig, Range, User, X2Data } from '@models';
|
||||
import { JumpsService, JumpTableService, UserService } from '@services';
|
||||
import data from 'src/jumps.json';
|
||||
//import data from 'src/jumps_02.json';
|
||||
|
||||
@Component({
|
||||
imports: [
|
||||
@@ -190,28 +188,6 @@ export class LogbookComponent implements OnInit, OnDestroy, AfterContentChecked
|
||||
}
|
||||
}
|
||||
|
||||
importJumps() {
|
||||
try {
|
||||
data.forEach((entry) => {
|
||||
Object.assign(this.jump, entry);
|
||||
this._jumpsService
|
||||
.save(this.jump)
|
||||
.pipe(take(1))
|
||||
.subscribe({
|
||||
next: (jump) => {
|
||||
console.log(`Le saut n°${jump.numero} a été ajouté !`, 'OK');
|
||||
},
|
||||
error: (err) => {
|
||||
console.log(`Le saut n'a pas été ajouté !`, 'Error', err);
|
||||
this.errors = err;
|
||||
},
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
openAddDialog(): void {
|
||||
this.jump = <Jump>{};
|
||||
this.jump.numero = this.lastJump.numero + 1;
|
||||
|
||||
Reference in New Issue
Block a user