diff --git a/src/tasks/queries.ts b/src/tasks/queries.ts index fceaa47..fd18882 100644 --- a/src/tasks/queries.ts +++ b/src/tasks/queries.ts @@ -3,13 +3,17 @@ import { HttpError } from "wasp/server"; import { type GetTasks } from "wasp/server/operations"; //Using TypeScript's new 'satisfies' keyword, it will infer the types of the arguments and return value -export const getTasks = ((_args, context) => { +export const getTasks = (async (_args, context) => { if (!context.user) { throw new HttpError(401); } - return context.entities.Task.findMany({ + const tasks = await context.entities.Task.findMany({ where: { user: { id: context.user.id } }, orderBy: { id: "asc" }, }); + return tasks.map((task) => { + task.description = task.description.toUpperCase(); + return task; + }); }) satisfies GetTasks;