Skip to content

Commit d1c8db5

Browse files
committed
Update server
1 parent 10fa111 commit d1c8db5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/tasks/queries.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@ import { HttpError } from "wasp/server";
33
import { type GetTasks } from "wasp/server/operations";
44

55
//Using TypeScript's new 'satisfies' keyword, it will infer the types of the arguments and return value
6-
export const getTasks = ((_args, context) => {
6+
export const getTasks = (async (_args, context) => {
77
if (!context.user) {
88
throw new HttpError(401);
99
}
1010

11-
return context.entities.Task.findMany({
11+
const tasks = await context.entities.Task.findMany({
1212
where: { user: { id: context.user.id } },
1313
orderBy: { id: "asc" },
1414
});
15+
return tasks.map((task) => {
16+
task.description = task.description.toUpperCase();
17+
return task;
18+
});
1519
}) satisfies GetTasks<void, Task[]>;

0 commit comments

Comments
 (0)