File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,17 @@ import { HttpError } from "wasp/server";
3
3
import { type GetTasks } from "wasp/server/operations" ;
4
4
5
5
//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 ) => {
7
7
if ( ! context . user ) {
8
8
throw new HttpError ( 401 ) ;
9
9
}
10
10
11
- return context . entities . Task . findMany ( {
11
+ const tasks = await context . entities . Task . findMany ( {
12
12
where : { user : { id : context . user . id } } ,
13
13
orderBy : { id : "asc" } ,
14
14
} ) ;
15
+ return tasks . map ( ( task ) => {
16
+ task . description = task . description . toUpperCase ( ) ;
17
+ return task ;
18
+ } ) ;
15
19
} ) satisfies GetTasks < void , Task [ ] > ;
You can’t perform that action at this time.
0 commit comments