services
This commit is contained in:
20
src/api/routes/misc/getCategories.js
Normal file
20
src/api/routes/misc/getCategories.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import { getCategories } from '../../../services/misc/getCategories.js';
|
||||
|
||||
/**
|
||||
* @param {import('express').Application} app
|
||||
* @param {string} [basePath='']
|
||||
*/
|
||||
export function register(app, basePath = '') {
|
||||
/**
|
||||
* @route GET /misc/getCategories
|
||||
* @returns {Object} 200 - `{ categories, tree }`
|
||||
*/
|
||||
app.get(`${basePath}/misc/getCategories`, async (_req, res) => {
|
||||
try {
|
||||
const result = await getCategories();
|
||||
res.status(200).json(result);
|
||||
} catch (error) {
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
});
|
||||
}
|
||||
19
src/api/routes/misc/getSteuer.js
Normal file
19
src/api/routes/misc/getSteuer.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import { getSteuer } from '../../../services/misc/getSteuer.js';
|
||||
|
||||
/**
|
||||
* @param {import('express').Application} app
|
||||
* @param {string} [basePath='']
|
||||
*/
|
||||
export function register(app, basePath = '') {
|
||||
/**
|
||||
* @route GET /misc/getSteuer
|
||||
* @returns {Object} 200 - `{ steuerklassen }`
|
||||
*/
|
||||
app.get(`${basePath}/misc/getSteuer`, async (_req, res) => {
|
||||
try {
|
||||
res.status(200).json(await getSteuer());
|
||||
} catch (error) {
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user