mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
add husky
This commit is contained in:
@@ -18,7 +18,7 @@ const metricReader = new PeriodicExportingMetricReader({
|
||||
// }
|
||||
}),
|
||||
exportIntervalMillis: 1000,
|
||||
})
|
||||
});
|
||||
|
||||
meterProvider.addMetricReader(metricReader);
|
||||
|
||||
@@ -27,32 +27,29 @@ const requestCounter = meter.createCounter('post_requests', {
|
||||
description: 'Example of a Counter',
|
||||
});
|
||||
|
||||
|
||||
@Injectable()
|
||||
export class MetricsInterceptor implements HttpInterceptor {
|
||||
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
||||
|
||||
|
||||
return next.handle(req).pipe(
|
||||
tap(event => {
|
||||
if (event instanceof HttpResponse) {
|
||||
// Capture the status code
|
||||
// Capture the status code and check protocol
|
||||
if (req.method !== 'GET' && !req.urlWithParams.includes('metrics')) {
|
||||
const path = req.urlWithParams;
|
||||
const url = new URL(path);
|
||||
let attributes = { path: url.pathname, method: req.method };
|
||||
const statusCode = event.status;
|
||||
const extendedAttributes = { ...attributes, status: statusCode };
|
||||
requestCounter.add(1, extendedAttributes);
|
||||
if (!window.location.origin.includes('https:')) {
|
||||
let attributes = { path: url.pathname, method: req.method };
|
||||
const statusCode = event.status;
|
||||
const extendedAttributes = { ...attributes, status: statusCode };
|
||||
requestCounter.add(1, extendedAttributes);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const metricsInterceptor = {
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
useClass: MetricsInterceptor,
|
||||
|
||||
@@ -186,6 +186,13 @@ export class AgendaDataRepositoryService {
|
||||
|
||||
updateEvent(eventId, eventData, editAllEvent, calendar: TableSharedCalendar) {
|
||||
|
||||
let body;
|
||||
if(typeof eventData?.Body == 'object') {
|
||||
body = eventData?.Body?.Text
|
||||
} else {
|
||||
body = eventData?.Body
|
||||
}
|
||||
|
||||
let eventInput = {
|
||||
userId: calendar.wxUserId,
|
||||
ownerType: this.utils.selectedCalendarOwner(calendar.role),
|
||||
|
||||
Reference in New Issue
Block a user