chore: apply Biome cleanup

This commit is contained in:
2026-06-11 04:56:01 +02:00
parent ac3dfe69cd
commit 18a192a069
11 changed files with 41 additions and 32 deletions
+2 -5
View File
@@ -10,10 +10,7 @@
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// This can be used to network with other containers or with the host.
"forwardPorts": [
3000,
5432
],
"forwardPorts": [3000, 5432],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bun i",
// Use 'postStartCommand' to run commands after the container is started.
@@ -38,4 +35,4 @@
"containerEnv": {
"SHELL": "/bin/bash"
}
}
}
+2 -2
View File
@@ -11,5 +11,5 @@
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
}
}
}
+1 -1
View File
@@ -63,4 +63,4 @@
}
}
}
}
}
+1 -1
View File
@@ -18,4 +18,4 @@
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
}
-1
View File
@@ -2,7 +2,6 @@ import type { NextConfig } from "next"
const nextConfig: NextConfig = {
/* config options here */
}
export default nextConfig
+6 -7
View File
@@ -1,13 +1,6 @@
"use server"
import { revalidatePath } from "next/cache"
import { getAuthenticatedUserId } from "@/services/auth.service"
import {
createAssignmentUseCase,
returnAssignmentUseCase,
updateAssignmentUseCase,
} from "@/use-cases/assignment.use-cases"
import {
assignmentSchema,
type CreateAssignmentFormType,
@@ -15,6 +8,12 @@ import {
type UpdateAssignmentFormType,
updateAssignmentSchema,
} from "@/schemas/assignment.schema"
import { getAuthenticatedUserId } from "@/services/auth.service"
import {
createAssignmentUseCase,
returnAssignmentUseCase,
updateAssignmentUseCase,
} from "@/use-cases/assignment.use-cases"
export async function createAssignment(formData: CreateAssignmentFormType) {
const createdBy = await getAuthenticatedUserId()
+1 -3
View File
@@ -77,9 +77,7 @@ export default async function AssignmentsPage(props: {
<td className="p-4">
{assignment?.asset?.serialNumber || "N/A"}
</td>
<td className="p-4">
{assignment?.quantity}
</td>
<td className="p-4">{assignment?.quantity}</td>
<td className="p-4">
<div className="flex gap-2">
<Link
+1 -1
View File
@@ -8,4 +8,4 @@ export default function ForbiddenPage() {
<Link href="/">Volver al inicio</Link>
</main>
)
}
}
+20 -8
View File
@@ -1,14 +1,25 @@
import type { Prisma } from "@/generated/prisma/client"
import type { PaginatedResult } from "@/types"
type PaginationModel<T> = {
findMany(args: {
where?: unknown
skip: number
take: number
orderBy?: unknown
include?: unknown
select?: unknown
}): Promise<T[]>
count(args: { where?: unknown }): Promise<number>
}
type PaginationArgs<_T> = {
model: any
where?: Prisma.Enumerable<any>
model: unknown
where?: unknown
page?: number
pageSize?: number
orderBy?: any
include?: Prisma.Enumerable<any>
select?: Prisma.Enumerable<any>
orderBy?: unknown
include?: unknown
select?: unknown
}
export async function paginate<T>({
@@ -21,9 +32,10 @@ export async function paginate<T>({
select,
}: PaginationArgs<T>): Promise<PaginatedResult<T>> {
const skip = (page - 1) * pageSize
const paginatedModel = model as PaginationModel<T>
const [data, totalItems] = await Promise.all([
model.findMany({
paginatedModel.findMany({
where,
skip,
take: pageSize,
@@ -31,7 +43,7 @@ export async function paginate<T>({
include,
select,
}),
model.count({ where }),
paginatedModel.count({ where }),
])
return {
+1 -1
View File
@@ -1,4 +1,4 @@
import { execFileSync, spawn, type ChildProcess } from "node:child_process"
import { type ChildProcess, execFileSync, spawn } from "node:child_process"
import process from "node:process"
import {
PostgreSqlContainer,
@@ -60,7 +60,9 @@ describe("assignment use-cases", () => {
prisma.assignment.findUniqueOrThrow({
where: { id: result.assignmentId },
}),
prisma.movement.findMany({ orderBy: [{ createdAt: "asc" }, { id: "asc" }] }),
prisma.movement.findMany({
orderBy: [{ createdAt: "asc" }, { id: "asc" }],
}),
])
expect(updatedItem.stock).toBe(3)
@@ -138,7 +140,9 @@ describe("assignment use-cases", () => {
prisma.assignment.findUniqueOrThrow({
where: { id: created.assignmentId },
}),
prisma.movement.findMany({ orderBy: [{ createdAt: "asc" }, { id: "asc" }] }),
prisma.movement.findMany({
orderBy: [{ createdAt: "asc" }, { id: "asc" }],
}),
])
expect(updatedItem.stock).toBe(4)