fix: restore table version improvement
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 15s

This commit is contained in:
Mihajlo Medjedovic 2024-04-30 15:43:17 +02:00
parent 1589c799ec
commit 549f35766b
3 changed files with 17 additions and 4 deletions

View File

@ -0,0 +1,9 @@
import { BaseSASResponse } from "./common/BaseSASResponse";
export interface EditorsRestoreServiceResponse extends BaseSASResponse {
restore_out: RestoreOut[]
}
export interface RestoreOut {
LOADREF: string
}

View File

@ -98,7 +98,7 @@
[clrLoading]="revertingChanges"
class="btn btn-sm btn-danger text-center mt-20"
>
REVERT (Coming Soon)
REVERT
<clr-tooltip-content
clrPosition="bottom-left"

View File

@ -4,10 +4,10 @@ import { Router } from '@angular/router'
import { ActivatedRoute } from '@angular/router'
import { SasService } from '../services/sas.service'
import { EventService } from '../services/event.service'
import { AppService } from '../services/app.service'
import { HotTableInterface } from '../models/HotTable.interface'
import { LicenceService } from '../services/licence.service'
import { globals } from '../_globals'
import { EditorsRestoreServiceResponse } from '../models/sas/editors-restore.model'
@Component({
selector: 'app-stage',
@ -174,8 +174,12 @@ export class StageComponent implements OnInit {
]
}
this.sasService.request('editors/restore', data).then(res => {
console.log('res', res)
this.sasService.request('editors/restore', data).then((res: EditorsRestoreServiceResponse) => {
if (res.restore_out) {
this.route.navigate([`/stage`]).then(() => {
this.route.navigate([`/stage/${res.restore_out[0].LOADREF}`])
})
}
}).finally(() => {
this.revertingChanges = false
})