From da6c68629daa9a5f015df8101562a67e3d7951d3 Mon Sep 17 00:00:00 2001 From: link2xt Date: Tue, 15 Nov 2022 14:58:17 +0000 Subject: [PATCH] jsonrpc: do not return a result from deleteContact() It was always true anyway. --- deltachat-jsonrpc/src/api/mod.rs | 4 ++-- node/test/test.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deltachat-jsonrpc/src/api/mod.rs b/deltachat-jsonrpc/src/api/mod.rs index bbc9c56a7..e00db7217 100644 --- a/deltachat-jsonrpc/src/api/mod.rs +++ b/deltachat-jsonrpc/src/api/mod.rs @@ -1146,12 +1146,12 @@ impl CommandApi { Ok(contacts) } - async fn delete_contact(&self, account_id: u32, contact_id: u32) -> Result { + async fn delete_contact(&self, account_id: u32, contact_id: u32) -> Result<()> { let ctx = self.get_context(account_id).await?; let contact_id = ContactId::new(contact_id); Contact::delete(&ctx, contact_id).await?; - Ok(true) + Ok(()) } async fn change_contact_name( diff --git a/node/test/test.js b/node/test/test.js index c15f5e7d3..2b4bc6d20 100644 --- a/node/test/test.js +++ b/node/test/test.js @@ -616,7 +616,7 @@ describe('Offline Tests with unconfigured account', function () { const id = context.createContact('someuser', 'someuser@site.com') const contact = context.getContact(id) strictEqual(contact.getId(), id, 'contact id matches') - strictEqual(context.deleteContact(id), true, 'delete call succesful') + context.deleteContact(id) strictEqual(context.getContact(id), null, 'contact is gone') })