Adding version to GetSite. Fixes #1001

This commit is contained in:
Dessalines 2020-07-21 00:13:45 -04:00
parent f93f2fe03c
commit 9a12560c80
6 changed files with 10 additions and 0 deletions

View file

@ -754,6 +754,8 @@ Search types are `All, Comments, Posts, Communities, Users, Url`
site: Option<SiteView>,
admins: Vec<UserView>,
banned: Vec<UserView>,
online: usize,
version: String,
}
}
```

View file

@ -3,6 +3,7 @@ use crate::{
api::{claims::Claims, APIError, Oper, Perform},
apub::fetcher::search_by_apub_id,
blocking,
version,
websocket::{server::SendAllMessage, UserOperation, WebsocketInfo},
DbPool,
LemmyError,
@ -110,6 +111,7 @@ pub struct GetSiteResponse {
admins: Vec<UserView>,
banned: Vec<UserView>,
pub online: usize,
version: String,
}
#[derive(Serialize, Deserialize)]
@ -424,6 +426,7 @@ impl Perform for Oper<GetSite> {
admins,
banned,
online,
version: version::VERSION.to_string(),
})
}
}
@ -666,6 +669,7 @@ impl Perform for Oper<TransferSite> {
admins,
banned,
online: 0,
version: version::VERSION.to_string(),
})
}
}

View file

@ -46,6 +46,7 @@ export class AdminSettings extends Component<any, AdminSettingsState> {
admins: [],
banned: [],
online: null,
version: null,
},
siteConfigForm: {
config_hjson: null,

View file

@ -107,6 +107,7 @@ export class Main extends Component<any, MainState> {
admins: [],
banned: [],
online: null,
version: null,
},
showEditSite: false,
loading: true,

View file

@ -92,6 +92,7 @@ export class Post extends Component<any, PostState> {
enable_nsfw: undefined,
},
online: null,
version: null,
},
};

View file

@ -758,6 +758,7 @@ export interface GetSiteResponse {
admins: Array<UserView>;
banned: Array<UserView>;
online: number;
version: string;
}
export interface SiteResponse {