import {inject, InjectionToken} from '@angular/core';
import {HttpInterceptor} from '@angular/common/http';

import {Logger, NotificationService} from 'm2-core';
import {CdErrorHandlerInterceptor} from './cd-error-handler-interceptor';


export const CD_HTTP_INTERCEPTORS = new InjectionToken<HttpInterceptor[]>('CD_HTTP_INTERCEPTORS', {
    providedIn: 'root',
    factory: () => {
        return [
            new CdErrorHandlerInterceptor(inject(Logger), inject(NotificationService))
        ];
    },
});
