resolve issues with new features
This commit is contained in:
@@ -1,13 +1,23 @@
|
||||
import { Request, Response } from 'express';
|
||||
import environment from '../config/environment';
|
||||
import settingsService from '../services/settings.service';
|
||||
|
||||
class ConfigController {
|
||||
async getExternalLinks(_req: Request, res: Response): Promise<void> {
|
||||
const links: Record<string, string> = {};
|
||||
if (environment.nextcloudUrl) links.nextcloud = environment.nextcloudUrl;
|
||||
if (environment.bookstack.url) links.bookstack = environment.bookstack.url;
|
||||
if (environment.vikunja.url) links.vikunja = environment.vikunja.url;
|
||||
res.status(200).json({ success: true, data: links });
|
||||
const envLinks: Record<string, string> = {};
|
||||
if (environment.nextcloudUrl) envLinks.nextcloud = environment.nextcloudUrl;
|
||||
if (environment.bookstack.url) envLinks.bookstack = environment.bookstack.url;
|
||||
if (environment.vikunja.url) envLinks.vikunja = environment.vikunja.url;
|
||||
|
||||
const customLinks = await settingsService.getExternalLinks();
|
||||
|
||||
res.status(200).json({
|
||||
success: true,
|
||||
data: {
|
||||
...envLinks,
|
||||
customLinks,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user