merge changes
parent: tbd commit: 5213bdc
1 | use Error; |
2 | |
3 | use PgPool; |
4 | |
5 | use crate |
6 | UserBioRequest, UserBioResponse, UserDisplayImageRequest, UserDisplayImageResponse, |
7 | UserDisplayNameRequest, UserDisplayNameResponse, |
8 | ; |
9 | |
10 | use ; |
11 | |
12 | |
13 | pub pg_pool: PgPool, |
14 | |
15 | |
16 | |
17 | |
18 | Self |
19 | |
20 | |
21 | |
22 | |
23 | |
24 | async |
25 | &mut self, |
26 | request: UserDisplayNameRequest, |
27 | |
28 | let db_row = query_as! |
29 | UserRow, |
30 | r#"SELECT * FROM users WHERE username = $1"#, |
31 | request.user.username |
32 | |
33 | .fetch_one |
34 | .await.unwrap; |
35 | |
36 | Ok |
37 | display_name: db_row.display_name, |
38 | |
39 | |
40 | |
41 | async |
42 | &mut self, |
43 | request: UserDisplayImageRequest, |
44 | |
45 | let db_row = query_as! |
46 | UserRow, |
47 | r#"SELECT * FROM users WHERE username = $1"#, |
48 | request.user.username |
49 | |
50 | .fetch_one |
51 | .await.unwrap; |
52 | |
53 | Ok |
54 | image_url: db_row.image_url, |
55 | |
56 | |
57 | |
58 | async |
59 | &mut self, |
60 | request: UserBioRequest, |
61 | |
62 | let db_row = query_as! |
63 | UserRow, |
64 | r#"SELECT * FROM users WHERE username = $1"#, |
65 | request.user.username |
66 | |
67 | .fetch_one |
68 | .await.unwrap; |
69 | |
70 | Ok |
71 | |
72 | |
73 | |
74 | |
75 | |
76 | async |
77 | todo! |
78 | |
79 | |
80 | async |
81 | todo! |
82 | |
83 | |
84 | |
85 | |
86 | |
87 | pub username: String, |
88 | pub image_url: , |
89 | pub display_name: , |
90 | pub bio: , |
91 | pub email: , |
92 | pub password: String, |
93 | |
94 |