Skip to content

Commit

Permalink
feat(app): Using new entity contact endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandarDev committed Sep 30, 2023
1 parent f81ccaf commit 274962a
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions web/apps/app/src/contacts/ContactRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,14 @@ export async function setMetadataAsync(pointer: IContactPointer, metadataSeriali
}

export async function setAsync(pointer: IContactPointer, valueSerialized: string | undefined, timeStamp?: Date | undefined) {
await requestAsync('/contact/set', 'post', {
entityId: pointer.entityId,
contactName: pointer.contactName,
channelName: pointer.channelName,
await requestAsync(`/entity/${pointer.entityId}/contacts/${pointer.channelName}/${pointer.contactName}`, 'put', {
valueSerialized: valueSerialized,
timeStamp: timeStamp?.toISOString()
});
}

export async function deleteContactAsync(pointer: IContactPointer) {
await requestAsync('/contact', 'delete', {
entityId: pointer.entityId,
contactName: pointer.contactName,
channelName: pointer.channelName
});
await requestAsync(`/entity/${pointer.entityId}/contacts/${pointer.channelName}/${pointer.contactName}`, 'delete');
}

export async function historiesAsync(targets: IContactPointer[] | undefined, duration: number) {
Expand Down

0 comments on commit 274962a

Please sign in to comment.