diff --git a/src/lib/clients/clients.ts b/src/lib/clients/clients.ts index 4463ff7..64a517b 100644 --- a/src/lib/clients/clients.ts +++ b/src/lib/clients/clients.ts @@ -14,11 +14,9 @@ export class Clients { return data } - async getByName(clientName: string): Promise { + async getByName(clientName: string): Promise { const clients = await this.getAll() - const client = clients.find((c) => c.name === clientName) - if (!client) throw new Error(`Can't find client with name of ${clientName}`) - return client + return clients.find((c) => c.name === clientName) } async getByExternalId(customerId: string): Promise {