mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-03-24 09:35:06 +00:00
refactor!: serve the static frontend trough the backend (#520)
Co-authored-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import { version as currentVersion } from '$app/environment';
|
||||
import type { AllAppConfig, AppConfigRawResponse } from '$lib/types/application-configuration';
|
||||
import axios from 'axios';
|
||||
import APIService from './api-service';
|
||||
|
||||
export default class AppConfigService extends APIService {
|
||||
@@ -55,28 +53,6 @@ export default class AppConfigService extends APIService {
|
||||
await this.api.post('/application-configuration/sync-ldap');
|
||||
}
|
||||
|
||||
async getVersionInformation() {
|
||||
const response = await axios
|
||||
.get('https://api.github.com/repos/pocket-id/pocket-id/releases/latest', {
|
||||
timeout: 2000
|
||||
})
|
||||
.then((res) => res.data)
|
||||
.catch(() => null);
|
||||
|
||||
let newestVersion: string | undefined;
|
||||
let isUpToDate: boolean | undefined;
|
||||
if (response) {
|
||||
newestVersion = response.tag_name.replace('v', '');
|
||||
isUpToDate = newestVersion === currentVersion;
|
||||
}
|
||||
|
||||
return {
|
||||
isUpToDate,
|
||||
newestVersion,
|
||||
currentVersion
|
||||
};
|
||||
}
|
||||
|
||||
private parseConfigList(data: AppConfigRawResponse) {
|
||||
const appConfig: Partial<AllAppConfig> = {};
|
||||
data.forEach(({ key, value }) => {
|
||||
|
||||
Reference in New Issue
Block a user