diff --git a/src/abstractions/api.service.ts b/src/abstractions/api.service.ts index de665c8bb6..13b424dea4 100644 --- a/src/abstractions/api.service.ts +++ b/src/abstractions/api.service.ts @@ -256,7 +256,7 @@ export abstract class ApiService { token: string) => Promise>; getEventsOrganizationUser: (organizationId: string, id: string, start: string, end: string, token: string) => Promise>; - postEventsCollectMany: (request: EventRequest[]) => Promise; + postEventsCollect: (request: EventRequest[]) => Promise; getUserPublicKey: (id: string) => Promise; diff --git a/src/services/api.service.ts b/src/services/api.service.ts index 2b21da77d7..ab840ca5a6 100644 --- a/src/services/api.service.ts +++ b/src/services/api.service.ts @@ -841,14 +841,14 @@ export class ApiService implements ApiServiceAbstraction { return new ListResponse(r, EventResponse); } - async postEventsCollectMany(request: EventRequest[]): Promise { + async postEventsCollect(request: EventRequest[]): Promise { const authHeader = await this.getActiveBearerToken(); const headers = new Headers({ 'Device-Type': this.deviceType, 'Authorization': 'Bearer ' + authHeader, 'Content-Type': 'application/json; charset=utf-8', }); - const response = await this.fetch(new Request(this.eventsBaseUrl + '/collect/many', { + const response = await this.fetch(new Request(this.eventsBaseUrl + '/collect', { cache: 'no-cache', credentials: this.getCredentials(), method: 'POST', diff --git a/src/services/eventService.ts b/src/services/event.service.ts similarity index 97% rename from src/services/eventService.ts rename to src/services/event.service.ts index 86ce3f94db..b393546554 100644 --- a/src/services/eventService.ts +++ b/src/services/event.service.ts @@ -71,7 +71,7 @@ export class EventService implements EventServiceAbstraction { return req; }); try { - await this.apiService.postEventsCollectMany(request); + await this.apiService.postEventsCollect(request); await this.storageService.remove(ConstantsService.eventCollectionKey); } catch { } }