import { DBCredit } from './types';
async findAllTest(data: Partial<DBCredit>): Promise<DBCredit[]> {
try {
const foundCredit = await this.db.query.credits.findMany({
where: { ...data }, // Pass partial data for filtering
});
return foundCredit;
} catch (error) {
console.error('Error fetching credits:', error);
throw error;
}
}
import { DBCredit } from './types';
async findAllTest(data: Partial<DBCredit>): Promise<DBCredit[]> {
try {
const foundCredit = await this.db.query.credits.findMany({
where: { ...data }, // Pass partial data for filtering
});
return foundCredit;
} catch (error) {
console.error('Error fetching credits:', error);
throw error;
}
}