Fix editing users in Organization

This commit is contained in:
Miroslav Prasil
2018-09-04 11:24:53 +01:00
parent b1ac37609f
commit 049aa33f17
2 changed files with 32 additions and 22 deletions

View File

@@ -270,6 +270,13 @@ impl UserOrganization {
.first::<Self>(&**conn).ok()
}
pub fn find_by_uuid_and_org(uuid: &str, org_uuid: &str, conn: &DbConn) -> Option<Self> {
users_organizations::table
.filter(users_organizations::uuid.eq(uuid))
.filter(users_organizations::org_uuid.eq(org_uuid))
.first::<Self>(&**conn).ok()
}
pub fn find_by_user(user_uuid: &str, conn: &DbConn) -> Vec<Self> {
users_organizations::table
.filter(users_organizations::user_uuid.eq(user_uuid))