diff options
Diffstat (limited to 'server/src/actions/user.rs')
-rw-r--r-- | server/src/actions/user.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/server/src/actions/user.rs b/server/src/actions/user.rs index ea6f36e6..58cfd89d 100644 --- a/server/src/actions/user.rs +++ b/server/src/actions/user.rs @@ -67,6 +67,10 @@ impl User_ { Self::create(&conn, &edited_user) } + pub fn read_from_name(conn: &PgConnection, from_user_name: String) -> Result<Self, Error> { + user_.filter(name.eq(from_user_name)) + .first::<Self>(conn) + } } #[derive(Debug, Serialize, Deserialize)] |