mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-03-28 06:05:29 +00:00
* Get rid of `Option<Vec<_>>` in api structs (fixes #2820) * update js client * only responses
This commit is contained in:
parent
253230a5cb
commit
359942272a
5 changed files with 13 additions and 15 deletions
|
@ -29,7 +29,7 @@
|
||||||
"eslint": "^9.20.0",
|
"eslint": "^9.20.0",
|
||||||
"eslint-plugin-prettier": "^5.2.3",
|
"eslint-plugin-prettier": "^5.2.3",
|
||||||
"jest": "^29.5.0",
|
"jest": "^29.5.0",
|
||||||
"lemmy-js-client": "0.20.0-show-mod-reports.2",
|
"lemmy-js-client": "0.20.0-api-no-optional-vec.1",
|
||||||
"prettier": "^3.5.0",
|
"prettier": "^3.5.0",
|
||||||
"ts-jest": "^29.1.0",
|
"ts-jest": "^29.1.0",
|
||||||
"tsoa": "^6.6.0",
|
"tsoa": "^6.6.0",
|
||||||
|
|
|
@ -33,8 +33,8 @@ importers:
|
||||||
specifier: ^29.5.0
|
specifier: ^29.5.0
|
||||||
version: 29.7.0(@types/node@22.13.1)
|
version: 29.7.0(@types/node@22.13.1)
|
||||||
lemmy-js-client:
|
lemmy-js-client:
|
||||||
specifier: 0.20.0-show-mod-reports.2
|
specifier: 0.20.0-api-no-optional-vec.1
|
||||||
version: 0.20.0-show-mod-reports.2
|
version: 0.20.0-api-no-optional-vec.1
|
||||||
prettier:
|
prettier:
|
||||||
specifier: ^3.5.0
|
specifier: ^3.5.0
|
||||||
version: 3.5.0
|
version: 3.5.0
|
||||||
|
@ -1528,8 +1528,8 @@ packages:
|
||||||
resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==}
|
resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
|
|
||||||
lemmy-js-client@0.20.0-show-mod-reports.2:
|
lemmy-js-client@0.20.0-api-no-optional-vec.1:
|
||||||
resolution: {integrity: sha512-92Zgs5/Nf8h57U5kgL0Q9BZzoTG0JUTGSGg1e9DORzQFVfYv53dzKpdjNxvuHsxlmT4eOeZgCuyUGdRipYy6jw==}
|
resolution: {integrity: sha512-oIlTCiriuZVzTMScix4ubJyIOf3x0FPpnxCfm12EYbiix3Z9D44XMWs3JTV+ipJgmiAqgAiGhI0fF35RNu3FjQ==}
|
||||||
|
|
||||||
leven@3.1.0:
|
leven@3.1.0:
|
||||||
resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==}
|
resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==}
|
||||||
|
@ -4169,7 +4169,7 @@ snapshots:
|
||||||
|
|
||||||
kleur@3.0.3: {}
|
kleur@3.0.3: {}
|
||||||
|
|
||||||
lemmy-js-client@0.20.0-show-mod-reports.2: {}
|
lemmy-js-client@0.20.0-api-no-optional-vec.1: {}
|
||||||
|
|
||||||
leven@3.1.0: {}
|
leven@3.1.0: {}
|
||||||
|
|
||||||
|
|
|
@ -69,8 +69,8 @@ pub async fn leave_admin(
|
||||||
version: VERSION.to_string(),
|
version: VERSION.to_string(),
|
||||||
all_languages,
|
all_languages,
|
||||||
discussion_languages,
|
discussion_languages,
|
||||||
oauth_providers: Some(oauth_providers),
|
oauth_providers,
|
||||||
admin_oauth_providers: None,
|
admin_oauth_providers: vec![],
|
||||||
blocked_urls,
|
blocked_urls,
|
||||||
tagline,
|
tagline,
|
||||||
my_user: None,
|
my_user: None,
|
||||||
|
|
|
@ -417,10 +417,8 @@ pub struct GetSiteResponse {
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
pub tagline: Option<Tagline>,
|
pub tagline: Option<Tagline>,
|
||||||
/// A list of external auth methods your site supports.
|
/// A list of external auth methods your site supports.
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
pub oauth_providers: Vec<PublicOAuthProvider>,
|
||||||
pub oauth_providers: Option<Vec<PublicOAuthProvider>>,
|
pub admin_oauth_providers: Vec<OAuthProvider>,
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
|
||||||
pub admin_oauth_providers: Option<Vec<OAuthProvider>>,
|
|
||||||
pub blocked_urls: Vec<LocalSiteUrlBlocklist>,
|
pub blocked_urls: Vec<LocalSiteUrlBlocklist>,
|
||||||
// If true then uploads for post images or markdown images are disabled. Only avatars, icons and
|
// If true then uploads for post images or markdown images are disabled. Only avatars, icons and
|
||||||
// banners can be set.
|
// banners can be set.
|
||||||
|
|
|
@ -39,7 +39,7 @@ pub async fn get_site_v4(
|
||||||
.map(|l| l.local_user.admin)
|
.map(|l| l.local_user.admin)
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
{
|
{
|
||||||
site_response.admin_oauth_providers = None;
|
site_response.admin_oauth_providers = vec![];
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(Json(site_response))
|
Ok(Json(site_response))
|
||||||
|
@ -64,8 +64,8 @@ async fn read_site(context: &LemmyContext) -> LemmyResult<GetSiteResponse> {
|
||||||
discussion_languages,
|
discussion_languages,
|
||||||
blocked_urls,
|
blocked_urls,
|
||||||
tagline,
|
tagline,
|
||||||
oauth_providers: Some(oauth_providers),
|
oauth_providers,
|
||||||
admin_oauth_providers: Some(admin_oauth_providers),
|
admin_oauth_providers,
|
||||||
image_upload_disabled: context.settings().pictrs()?.image_upload_disabled,
|
image_upload_disabled: context.settings().pictrs()?.image_upload_disabled,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue