mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-26 22:31:20 +00:00
Restore Person::read
This commit is contained in:
parent
f77b0d758f
commit
32ad580239
1 changed files with 8 additions and 0 deletions
|
@ -19,6 +19,14 @@ impl Crud for Person {
|
||||||
type InsertForm = PersonInsertForm;
|
type InsertForm = PersonInsertForm;
|
||||||
type UpdateForm = PersonUpdateForm;
|
type UpdateForm = PersonUpdateForm;
|
||||||
type IdType = PersonId;
|
type IdType = PersonId;
|
||||||
|
async fn read(pool: &mut DbPool<'_>, person_id: PersonId) -> Result<Self, Error> {
|
||||||
|
let conn = &mut get_conn(pool).await?;
|
||||||
|
person::table
|
||||||
|
.filter(person::deleted.eq(false))
|
||||||
|
.find(person_id)
|
||||||
|
.first::<Self>(conn)
|
||||||
|
.await
|
||||||
|
}
|
||||||
|
|
||||||
async fn delete(pool: &mut DbPool<'_>, person_id: PersonId) -> Result<usize, Error> {
|
async fn delete(pool: &mut DbPool<'_>, person_id: PersonId) -> Result<usize, Error> {
|
||||||
let conn = &mut get_conn(pool).await?;
|
let conn = &mut get_conn(pool).await?;
|
||||||
|
|
Loading…
Reference in a new issue