Skip to content

Commit

Permalink
feat: setup uri for update messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Tr00d committed Sep 3, 2024
1 parent e5218d6 commit a4f69b8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Vonage.Test/Messages/Rcs/RcsMessagesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public async Task SendRcsVideoAsyncReturnsOk()
[Fact]
public async Task UpdateAsyncReturnsOk()
{
this.Setup(this.expectedUri, Maybe<string>.None, this.helper.GetRequestJson());
this.Setup($"{this.expectedUri}/ID-123", Maybe<string>.None, this.helper.GetRequestJson());
await this.client.MessagesClient.UpdateAsync(RcsUpdateMessageRequest.Build("ID-123"));
}

Expand Down
2 changes: 1 addition & 1 deletion Vonage.Test/Messages/WhatsApp/WhatsAppMessagesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ public async Task SendWhatsAppVideoAsyncReturnsOkWithContext()
[Fact]
public async Task UpdateAsyncReturnsOk()
{
this.Setup(this.expectedUri, Maybe<string>.None, this.helper.GetRequestJson());
this.Setup($"{this.expectedUri}/ID-123", Maybe<string>.None, this.helper.GetRequestJson());
await this.BuildVonageClient(Credentials.FromAppIdAndPrivateKey(this.AppId, this.PrivateKey))
.MessagesClient.UpdateAsync(WhatsAppUpdateMessageRequest.Build("ID-123"));
}
Expand Down
3 changes: 2 additions & 1 deletion Vonage/Messages/MessagesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public async Task UpdateAsync(IUpdateMessageRequest request)
var authType = this.credentials.GetPreferredAuthenticationType()
.IfFailure(failure => throw failure.ToException());
await ApiRequest.Build(this.credentials, this.configuration, this.timeProvider).DoRequestWithJsonContentAsync(
new HttpMethod("PATCH"), this.uri,
new HttpMethod("PATCH"), ApiRequest.GetBaseUri(ApiRequest.UriType.Api, this.configuration,
$"{Url}/{request.MessageUuid}"),
request,
authType,
value => JsonSerializerBuilder.BuildWithSnakeCase().SerializeObject(value),
Expand Down

0 comments on commit a4f69b8

Please sign in to comment.