@@ -37,8 +37,6 @@ import { ReportPermissions } from 'src/app/core/models/report-permissions.model'
3737import { ExtendedComment } from 'src/app/core/models/platform/v1/extended-comment.model' ;
3838import { Comment } from 'src/app/core/models/platform/v1/comment.model' ;
3939import { ExpenseTransactionStatus } from 'src/app/core/enums/platform/v1/expense-transaction-status.enum' ;
40- import * as Sentry from '@sentry/angular' ;
41- import { HttpErrorResponse } from '@angular/common/http' ;
4240
4341@Component ( {
4442 selector : 'app-my-view-report' ,
@@ -456,42 +454,14 @@ export class MyViewReportPage {
456454 this . spenderReportsService
457455 . submit ( this . reportId )
458456 . pipe ( finalize ( ( ) => ( this . submitReportLoader = false ) ) )
459- . subscribe ( {
460- next : ( ) => {
461- this . router . navigate ( [ '/' , 'enterprise' , 'my_reports' ] ) ;
462- const message = `Report submitted successfully.` ;
463- this . matSnackBar . openFromComponent ( ToastMessageComponent , {
464- ...this . snackbarProperties . setSnackbarProperties ( 'success' , { message } ) ,
465- panelClass : [ 'msb-success-with-camera-icon' ] ,
466- } ) ;
467- this . trackingService . showToastMessage ( { ToastContent : message } ) ;
468- } ,
469- error : ( error : HttpErrorResponse ) => {
470- const errorMessage = `Report Submit Error ${ error . status } : ${
471- error ?. message || error . statusText || 'Unknown Error'
472- } `;
473- const errorObj = new Error ( errorMessage ) ;
474-
475- Object . assign ( errorObj , {
476- status : error . status ,
477- url : error . url ,
478- responseData : error . message ,
479- name : `ReportSubmitError_${ this . reportId } ` ,
480- } ) ;
481-
482- Sentry . captureException ( errorObj , {
483- tags : {
484- errorType : 'REPORT_SUBMIT_ERROR' ,
485- reportId : this . reportId ,
486- } ,
487- extra : {
488- reportId : this . reportId ,
489- responseStatus : error . status ,
490- responseData : error . error ,
491- page : 'submit_report' ,
492- } ,
493- } ) ;
494- } ,
457+ . subscribe ( ( ) => {
458+ this . router . navigate ( [ '/' , 'enterprise' , 'my_reports' ] ) ;
459+ const message = `Report submitted successfully.` ;
460+ this . matSnackBar . openFromComponent ( ToastMessageComponent , {
461+ ...this . snackbarProperties . setSnackbarProperties ( 'success' , { message } ) ,
462+ panelClass : [ 'msb-success-with-camera-icon' ] ,
463+ } ) ;
464+ this . trackingService . showToastMessage ( { ToastContent : message } ) ;
495465 } ) ;
496466 }
497467
0 commit comments