Browse Source

how tf did i miss this interface

Matthew Trejo 1 month ago
parent
commit
eeb63b6164

+ 10 - 0
.claude/settings.local.json

@@ -0,0 +1,10 @@
+{
+  "permissions": {
+    "allow": [
+      "Bash(cat:*)",
+      "Bash(npm run build:*)"
+    ],
+    "deny": [],
+    "ask": []
+  }
+}

+ 13 - 6
src/app/api/clientes/[id]/route.ts

@@ -3,14 +3,19 @@ import { PrismaClient } from '@prisma/client'
 
 const prisma = new PrismaClient()
 
+type RouteParams = {
+  params: Promise<{ id: string }>
+}
+
 // GET - Obtener un cliente por ID
 export async function GET(
   request: NextRequest,
-  { params }: { params: { id: string } }
+  { params }: RouteParams
 ) {
   try {
+    const { id } = await params
     const cliente = await prisma.cliente.findUnique({
-      where: { id: params.id }
+      where: { id }
     })
 
     if (!cliente) {
@@ -33,13 +38,14 @@ export async function GET(
 // PUT - Actualizar cliente
 export async function PUT(
   request: NextRequest,
-  { params }: { params: { id: string } }
+  { params }: RouteParams
 ) {
   try {
+    const { id } = await params
     const body = await request.json()
 
     const cliente = await prisma.cliente.update({
-      where: { id: params.id },
+      where: { id },
       data: {
         tipoIdentificacion: body.tipoIdentificacion,
         identificacion: body.identificacion,
@@ -64,11 +70,12 @@ export async function PUT(
 // DELETE - Eliminar cliente
 export async function DELETE(
   request: NextRequest,
-  { params }: { params: { id: string } }
+  { params }: RouteParams
 ) {
   try {
+    const { id } = await params
     await prisma.cliente.delete({
-      where: { id: params.id }
+      where: { id }
     })
 
     return NextResponse.json({ success: true })

+ 3 - 0
src/hooks/useConfiguracionesTributarias.ts

@@ -13,6 +13,7 @@ interface ConfiguracionTributaria {
   estab: string
   ptoEmi: string
   secuencial: string
+  obligadoContabilidad: string
   activo: boolean
   createdAt: string
   updatedAt: string
@@ -28,6 +29,7 @@ interface CreateConfiguracionData {
   estab: string
   ptoEmi: string
   secuencial: string
+  obligadoContabilidad?: string
 }
 
 interface UpdateConfiguracionData {
@@ -40,6 +42,7 @@ interface UpdateConfiguracionData {
   estab?: string
   ptoEmi?: string
   secuencial?: string
+  obligadoContabilidad?: string
   activo?: boolean
 }