Merge pull request 'fix/clasificacion-conceptos' (#428) from fix/clasificacion-conceptos into development
Reviewed-on: ADUANASOFT/anexo76#428
This commit is contained in:
@@ -32,12 +32,15 @@ export async function getClassificationConcepts(
|
||||
companyId: number,
|
||||
filters: Record<string, any> = {}
|
||||
): Promise<ApiResponse<ClassificationConceptListResponse>> {
|
||||
const params = new URLSearchParams({
|
||||
const paramObj: Record<string, string> = {
|
||||
page: page.toString(),
|
||||
page_size: pageSize.toString(),
|
||||
company_id: companyId.toString(),
|
||||
...filters
|
||||
company_id: companyId.toString()
|
||||
};
|
||||
Object.entries(filters).forEach(([k, v]) => {
|
||||
if (v !== undefined && v !== null && v !== '') paramObj[k] = String(v);
|
||||
});
|
||||
const params = new URLSearchParams(paramObj);
|
||||
|
||||
return await api.get(`/v1/a76/classification-concepts/?${params.toString()}`);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,11 @@ export function createColumns(
|
||||
header: 'Clasificación',
|
||||
cell: ({ row }) => row.original.classification || '-'
|
||||
},
|
||||
{
|
||||
accessorKey: 'description',
|
||||
header: 'Descripción',
|
||||
cell: ({ row }) => row.original.description || '-'
|
||||
},
|
||||
{
|
||||
id: 'actions',
|
||||
header: 'Acciones',
|
||||
|
||||
@@ -169,8 +169,8 @@ const columns = $derived(createColumns(handleSuccess, { canEdit, canDelete }));
|
||||
<p class="text-muted-foreground">Catálogo de Clasificaciones de Conceptos</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-3">
|
||||
<Button variant="outline" size="sm" class="h-9" onclick={reloadData}>
|
||||
<RefreshCw class="mr-2 h-4 w-4" /> Actualizar
|
||||
<Button variant="outline" size="sm" class="h-9" onclick={reloadData} disabled={loading}>
|
||||
<RefreshCw class="mr-2 h-4 w-4 {loading ? 'animate-spin' : ''}" /> Actualizar
|
||||
</Button>
|
||||
{#if !isError && canCreate}
|
||||
<Button class="h-9" onclick={() => { editingItem = null; dialogOpen = true; }}>
|
||||
|
||||
Reference in New Issue
Block a user