mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-14 07:51:01 +00:00
Implement models::instance::Instance::get
This commit is contained in:
parent
f060fa08af
commit
4036d5771c
1 changed files with 6 additions and 2 deletions
|
@ -43,8 +43,12 @@ impl Instance {
|
|||
.expect("Error saving new instance")
|
||||
}
|
||||
|
||||
pub fn get(id: i32) -> Option<Instance> {
|
||||
None
|
||||
pub fn get(conn: &PgConnection, id: i32) -> Option<Instance> {
|
||||
instances::table.filter(instances::id.eq(id))
|
||||
.limit(1)
|
||||
.load::<Instance>(conn)
|
||||
.expect("Error loading local instance infos")
|
||||
.into_iter().nth(0)
|
||||
}
|
||||
|
||||
pub fn block(&self) {}
|
||||
|
|
Loading…
Reference in a new issue