Skip to content
Snippets Groups Projects
Commit 0f127df5 authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #13049 TIME 0:15 close and index on different group

parent d2ac4b8e
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,7 @@ import { ContinueAvisCircuitActionComponent } from './avis-continue-circuit-acti
import { SendAvisParallelComponent } from './avis-parallel-send-action/send-avis-parallel-action.component';
import { GiveAvisParallelActionComponent } from './avis-give-parallel-action/give-avis-parallel-action.component';
import { ValidateAvisParallelComponent } from './avis-parallel-validate-action/validate-avis-parallel-action.component';
import { HeaderService } from '../../service/header.service';
@Injectable()
export class ActionsService {
......@@ -62,6 +63,7 @@ export class ActionsService {
public dialog: MatDialog,
private notify: NotificationService,
private router: Router,
public headerService: HeaderService
) {
}
......@@ -301,7 +303,20 @@ export class ActionsService {
filter((data: string) => data === 'success'),
tap((result: any) => {
this.endAction(result);
this.router.navigate(['/indexing/' + this.currentGroupId]);
let firstGroup: number = 0;
this.headerService.user.groups.filter((group: any) => group.can_index === true).forEach((group: any) => {
if (firstGroup == 0) {
firstGroup = group.id;
}
if (group.id == this.currentGroupId) {
this.router.navigate(['/indexing/' + this.currentGroupId]);
}
});
if (firstGroup == 0) {
this.router.navigate(['/home']);
} else {
this.router.navigate(['/indexing/' + firstGroup]);
}
}),
finalize(() => this.loading = false),
catchError((err: any) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment