Files
oneuptime/Common/Server/API/GlobalConfigAPI.ts
Simon Larsen 714823514c Refactor import paths in test and UI component files for consistency
- Updated import statements in various test files to use relative paths instead of absolute paths.
- Adjusted import paths in UI components to ensure they correctly reference the Types and Models directories.
- Ensured all components and tests are aligned with the new directory structure for better maintainability.
2025-05-21 16:19:35 +01:00

46 lines
1.3 KiB
TypeScript

import GlobalConfigService, {
Service as GlobalConfigServiceType,
} from "../Services/GlobalConfigService";
import {
ExpressRequest,
ExpressResponse,
NextFunction,
} from "../Utils/Express";
import Response from "../Utils/Response";
import BaseAPI from "./BaseAPI";
import GlobalConfig from "../../Models/DatabaseModels/GlobalConfig";
export default class GlobalConfigAPI extends BaseAPI<
GlobalConfig,
GlobalConfigServiceType
> {
public constructor() {
super(GlobalConfig, GlobalConfigService);
this.router.get(
`${new this.entityType().getCrudApiPath()?.toString()}/vars`,
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
try {
// const globalConfig: GlobalConfig | null =
// await GlobalConfigService.findOneById({
// id: ObjectID.getZeroObjectID(),
// select: {
// useHttps: true,
// },
// props: {
// isRoot: true,
// },
// });
return Response.sendJsonObjectResponse(req, res, {
// USE_HTTPS:
// globalConfig?.useHttps?.toString() || 'false',
});
} catch (err) {
next(err);
}
},
);
}
}