style: clean up code formatting and remove trailing whitespace
refactor: reorganize imports and fix type imports
This commit is contained in:
1 parent
d3704602fd
commit
47c04de6fe
232 files changed
+7140
-4798
No files matched your search
@@ -26,7 +26,9 @@ export interface UnifiedItem {
|
||||
/**
|
||||
* Busca item por ID unificado
|
||||
*/
|
||||
export async function getItemByIdUnified(itemId: number): Promise<UnifiedItem | null> {
|
||||
export async function getItemByIdUnified(
|
||||
itemId: number,
|
||||
): Promise<UnifiedItem | null> {
|
||||
try {
|
||||
const result = await query<UnifiedItem>(
|
||||
`
|
||||
@@ -49,7 +51,7 @@ export async function getItemByIdUnified(itemId: number): Promise<UnifiedItem |
|
||||
FROM items
|
||||
WHERE item_id = $1
|
||||
`,
|
||||
[itemId]
|
||||
[itemId],
|
||||
);
|
||||
|
||||
if (result.rows.length === 0) {
|
||||
@@ -71,7 +73,9 @@ export async function getItemByIdUnified(itemId: number): Promise<UnifiedItem |
|
||||
/**
|
||||
* Busca item por nome (case-insensitive)
|
||||
*/
|
||||
export async function getItemByNameUnified(itemName: string): Promise<UnifiedItem | null> {
|
||||
export async function getItemByNameUnified(
|
||||
itemName: string,
|
||||
): Promise<UnifiedItem | null> {
|
||||
try {
|
||||
const result = await query<UnifiedItem>(
|
||||
`
|
||||
@@ -95,7 +99,7 @@ export async function getItemByNameUnified(itemName: string): Promise<UnifiedIte
|
||||
WHERE LOWER(item_name) = LOWER($1)
|
||||
LIMIT 1
|
||||
`,
|
||||
[itemName]
|
||||
[itemName],
|
||||
);
|
||||
|
||||
if (result.rows.length === 0) {
|
||||
@@ -123,7 +127,7 @@ export async function itemExists(itemId: number): Promise<boolean> {
|
||||
SELECT 1 FROM items WHERE item_id = $1
|
||||
) as exists
|
||||
`,
|
||||
[itemId]
|
||||
[itemId],
|
||||
);
|
||||
|
||||
return result.rows[0]?.exists || false;
|
||||
@@ -135,4 +139,3 @@ export async function itemExists(itemId: number): Promise<boolean> {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user