Skip to content

Commit 7589ab5

Browse files
committed
views/EncodablePrivateUser: Add is_admin field
1 parent df20fe5 commit 7589ab5

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/tests/routes/me/snapshots/all__routes__me__get__me-2.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ expression: response.into_json()
1010
"email_verification_sent": true,
1111
"email_verified": true,
1212
"id": 1,
13+
"is_admin": false,
1314
"login": "foo",
1415
"name": null,
1516
"url": "https://github.com/foo"

src/tests/routes/me/snapshots/all__routes__me__get__me-3.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ expression: response.into_json()
1616
"email_verification_sent": true,
1717
"email_verified": true,
1818
"id": 1,
19+
"is_admin": false,
1920
"login": "foo",
2021
"name": null,
2122
"url": "https://github.com/foo"

src/views.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ pub struct EncodablePrivateUser {
466466
pub email: Option<String>,
467467
pub avatar: Option<String>,
468468
pub url: Option<String>,
469+
pub is_admin: bool,
469470
}
470471

471472
impl EncodablePrivateUser {
@@ -481,6 +482,7 @@ impl EncodablePrivateUser {
481482
name,
482483
gh_login,
483484
gh_avatar,
485+
is_admin,
484486
..
485487
} = user;
486488
let url = format!("https://github.com/{gh_login}");
@@ -494,6 +496,7 @@ impl EncodablePrivateUser {
494496
login: gh_login,
495497
name,
496498
url: Some(url),
499+
is_admin,
497500
}
498501
}
499502
}

0 commit comments

Comments
 (0)