mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-24 12:06:15 +01:00
event post is always many
This commit is contained in:
parent
05859a1df3
commit
2830121471
@ -256,7 +256,7 @@ export abstract class ApiService {
|
|||||||
token: string) => Promise<ListResponse<EventResponse>>;
|
token: string) => Promise<ListResponse<EventResponse>>;
|
||||||
getEventsOrganizationUser: (organizationId: string, id: string,
|
getEventsOrganizationUser: (organizationId: string, id: string,
|
||||||
start: string, end: string, token: string) => Promise<ListResponse<EventResponse>>;
|
start: string, end: string, token: string) => Promise<ListResponse<EventResponse>>;
|
||||||
postEventsCollectMany: (request: EventRequest[]) => Promise<any>;
|
postEventsCollect: (request: EventRequest[]) => Promise<any>;
|
||||||
|
|
||||||
getUserPublicKey: (id: string) => Promise<UserKeyResponse>;
|
getUserPublicKey: (id: string) => Promise<UserKeyResponse>;
|
||||||
|
|
||||||
|
@ -841,14 +841,14 @@ export class ApiService implements ApiServiceAbstraction {
|
|||||||
return new ListResponse(r, EventResponse);
|
return new ListResponse(r, EventResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
async postEventsCollectMany(request: EventRequest[]): Promise<any> {
|
async postEventsCollect(request: EventRequest[]): Promise<any> {
|
||||||
const authHeader = await this.getActiveBearerToken();
|
const authHeader = await this.getActiveBearerToken();
|
||||||
const headers = new Headers({
|
const headers = new Headers({
|
||||||
'Device-Type': this.deviceType,
|
'Device-Type': this.deviceType,
|
||||||
'Authorization': 'Bearer ' + authHeader,
|
'Authorization': 'Bearer ' + authHeader,
|
||||||
'Content-Type': 'application/json; charset=utf-8',
|
'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',
|
cache: 'no-cache',
|
||||||
credentials: this.getCredentials(),
|
credentials: this.getCredentials(),
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
@ -71,7 +71,7 @@ export class EventService implements EventServiceAbstraction {
|
|||||||
return req;
|
return req;
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
await this.apiService.postEventsCollectMany(request);
|
await this.apiService.postEventsCollect(request);
|
||||||
await this.storageService.remove(ConstantsService.eventCollectionKey);
|
await this.storageService.remove(ConstantsService.eventCollectionKey);
|
||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user