feat(cfdi): add autocomplete for emisor and receptor filters
- Add /cfdi/emisores and /cfdi/receptores API endpoints - Search by RFC or nombre with ILIKE - Show suggestions dropdown while typing (min 2 chars) - Click suggestion to select and populate filter input - Show loading state while searching Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -98,3 +98,20 @@ export async function getCfdiXml(id: string): Promise<string> {
|
||||
});
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export interface EmisorReceptor {
|
||||
rfc: string;
|
||||
nombre: string;
|
||||
}
|
||||
|
||||
export async function searchEmisores(search: string): Promise<EmisorReceptor[]> {
|
||||
if (search.length < 2) return [];
|
||||
const response = await apiClient.get<EmisorReceptor[]>(`/cfdi/emisores?search=${encodeURIComponent(search)}`);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function searchReceptores(search: string): Promise<EmisorReceptor[]> {
|
||||
if (search.length < 2) return [];
|
||||
const response = await apiClient.get<EmisorReceptor[]>(`/cfdi/receptores?search=${encodeURIComponent(search)}`);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user