How could the following function be improved? I'm using the Prisma client as DB.
I'm learning TS at the moment and looking for feedback.
const all = async (): Promise<Task[]> => {
try {
const tasks: Task[] = await DB.tasks.findMany()
return tasks;
} catch (err) {
console.error(err)
return []
}
}