fix(plugins): use correct method name for message errors in host-api.ts
This commit is contained in:
@@ -397,7 +397,7 @@ async function doJmapImportRaw(
|
|||||||
async function doContactSearch(query: string): Promise<ContactCard[]> {
|
async function doContactSearch(query: string): Promise<ContactCard[]> {
|
||||||
const { client } = useAuthStore.getState();
|
const { client } = useAuthStore.getState();
|
||||||
if (!client) {
|
if (!client) {
|
||||||
throw new Error('jmap.importRaw: no active session');
|
throw new Error('contact.search: no active session');
|
||||||
}
|
}
|
||||||
return await client.searchContacts(query);
|
return await client.searchContacts(query);
|
||||||
}
|
}
|
||||||
@@ -405,7 +405,7 @@ async function doContactSearch(query: string): Promise<ContactCard[]> {
|
|||||||
async function doContactGet(contactId: string): Promise<ContactCard | null> {
|
async function doContactGet(contactId: string): Promise<ContactCard | null> {
|
||||||
const { client } = useAuthStore.getState();
|
const { client } = useAuthStore.getState();
|
||||||
if (!client) {
|
if (!client) {
|
||||||
throw new Error('jmap.importRaw: no active session');
|
throw new Error('contact.get: no active session');
|
||||||
}
|
}
|
||||||
return await client.getContact(contactId);
|
return await client.getContact(contactId);
|
||||||
}
|
}
|
||||||
@@ -413,7 +413,7 @@ async function doContactGet(contactId: string): Promise<ContactCard | null> {
|
|||||||
async function doContactUpdate(id: string, contact: Partial<ContactCard>): Promise<void> {
|
async function doContactUpdate(id: string, contact: Partial<ContactCard>): Promise<void> {
|
||||||
const { client } = useAuthStore.getState();
|
const { client } = useAuthStore.getState();
|
||||||
if (!client) {
|
if (!client) {
|
||||||
throw new Error('jmap.importRaw: no active session');
|
throw new Error('contact.update: no active session');
|
||||||
}
|
}
|
||||||
|
|
||||||
await client.updateContact(id, contact);
|
await client.updateContact(id, contact);
|
||||||
@@ -422,7 +422,7 @@ async function doContactUpdate(id: string, contact: Partial<ContactCard>): Promi
|
|||||||
async function doContactCreate(contact: ContactCard): Promise<ContactCard> {
|
async function doContactCreate(contact: ContactCard): Promise<ContactCard> {
|
||||||
const { client } = useAuthStore.getState();
|
const { client } = useAuthStore.getState();
|
||||||
if (!client) {
|
if (!client) {
|
||||||
throw new Error('jmap.importRaw: no active session');
|
throw new Error('contact.create: no active session');
|
||||||
}
|
}
|
||||||
|
|
||||||
return await client.createContact(contact);
|
return await client.createContact(contact);
|
||||||
|
|||||||
Reference in New Issue
Block a user