Checkpoint: Ventilations, automatismes, services et signatures sont maintenant globaux (sans filtre userId). Doublons supprimés en production.
This commit is contained in:
16
server/db.ts
16
server/db.ts
@@ -566,10 +566,10 @@ export async function upsertImportSettings(data: InsertImportSettings): Promise<
|
||||
|
||||
// ============= DEPARTMENT LIST OPERATIONS =============
|
||||
|
||||
export async function getDepartmentsByUser(userId: number): Promise<Department[]> {
|
||||
export async function getDepartmentsByUser(_userId?: number): Promise<Department[]> {
|
||||
const db = await getDb();
|
||||
if (!db) return [];
|
||||
return await db.select().from(departmentList).where(eq(departmentList.userId, userId)).orderBy(departmentList.name);
|
||||
return await db.select().from(departmentList).orderBy(departmentList.name);
|
||||
}
|
||||
|
||||
export async function createDepartment(data: InsertDepartment): Promise<Department> {
|
||||
@@ -587,10 +587,10 @@ export async function deleteDepartment(id: number): Promise<void> {
|
||||
|
||||
// ============= ACCOUNTING ALLOCATION LIST OPERATIONS =============
|
||||
|
||||
export async function getAccountingAllocationsByUser(userId: number): Promise<AccountingAllocation[]> {
|
||||
export async function getAccountingAllocationsByUser(_userId?: number): Promise<AccountingAllocation[]> {
|
||||
const db = await getDb();
|
||||
if (!db) return [];
|
||||
return await db.select().from(accountingAllocationList).where(eq(accountingAllocationList.userId, userId)).orderBy(accountingAllocationList.name);
|
||||
return await db.select().from(accountingAllocationList).orderBy(accountingAllocationList.name);
|
||||
}
|
||||
|
||||
export async function createAccountingAllocation(data: InsertAccountingAllocation): Promise<AccountingAllocation> {
|
||||
@@ -742,10 +742,10 @@ export async function initializeDefaultLlmFields(userId: number): Promise<void>
|
||||
|
||||
// ============= SIGNATURES HELPERS =============
|
||||
|
||||
export async function getSignaturesByUser(userId: number): Promise<Signature[]> {
|
||||
export async function getSignaturesByUser(_userId?: number): Promise<Signature[]> {
|
||||
const db = await getDb();
|
||||
if (!db) return [];
|
||||
return db.select().from(signatures).where(eq(signatures.userId, userId));
|
||||
return db.select().from(signatures);
|
||||
}
|
||||
|
||||
export async function getSignatureById(id: number): Promise<Signature | undefined> {
|
||||
@@ -773,10 +773,10 @@ export async function deleteSignature(id: number): Promise<void> {
|
||||
|
||||
// ============= SERVICE SIGNATURES HELPERS =============
|
||||
|
||||
export async function getServiceSignaturesByUser(userId: number): Promise<ServiceSignature[]> {
|
||||
export async function getServiceSignaturesByUser(_userId?: number): Promise<ServiceSignature[]> {
|
||||
const db = await getDb();
|
||||
if (!db) return [];
|
||||
return db.select().from(serviceSignatures).where(eq(serviceSignatures.userId, userId));
|
||||
return db.select().from(serviceSignatures);
|
||||
}
|
||||
|
||||
export async function getServiceSignatureByService(userId: number, serviceName: string): Promise<ServiceSignature | undefined> {
|
||||
|
||||
Reference in New Issue
Block a user