@@ -43,6 +43,7 @@ impl NewCrateOwnerInvitation {
4343 // already exists. This does not cause problems with expired invitation as those are
4444 // deleted before doing this INSERT.
4545 . on_conflict_do_nothing ( )
46+ . returning ( CrateOwnerInvitation :: as_returning ( ) )
4647 . get_result ( conn)
4748 . await
4849 . optional ( ) ?;
@@ -57,7 +58,7 @@ impl NewCrateOwnerInvitation {
5758}
5859
5960/// The model representing a row in the `crate_owner_invitations` database table.
60- #[ derive( Clone , Debug , Identifiable , Queryable ) ]
61+ #[ derive( Clone , Debug , Identifiable , Queryable , Selectable ) ]
6162#[ diesel( primary_key( invited_user_id, crate_id) ) ]
6263pub struct CrateOwnerInvitation {
6364 pub invited_user_id : i32 ,
@@ -77,13 +78,15 @@ impl CrateOwnerInvitation {
7778 ) -> QueryResult < Self > {
7879 crate_owner_invitations:: table
7980 . find ( ( user_id, crate_id) )
81+ . select ( CrateOwnerInvitation :: as_select ( ) )
8082 . first :: < Self > ( conn)
8183 . await
8284 }
8385
8486 pub async fn find_by_token ( token : & str , conn : & mut AsyncPgConnection ) -> QueryResult < Self > {
8587 crate_owner_invitations:: table
8688 . filter ( crate_owner_invitations:: token. eq ( token) )
89+ . select ( CrateOwnerInvitation :: as_select ( ) )
8790 . first :: < Self > ( conn)
8891 . await
8992 }
0 commit comments