CoreID/app/routing/routers/api/v1/settings.routes.js

26 lines
661 B
JavaScript

const settings_routes = {
prefix: '/api/v1/settings',
middleware: ['auth:APIRoute'],
get: {
'/': [
['middleware::api:Permission', { check: 'v1:settings:list' }],
'controller::api:v1:Settings.get_settings',
],
'/:key': [
['middleware::api:Permission', { check: 'v1:settings:get' }],
'controller::api:v1:Settings.get_setting',
],
},
patch: {
'/:key': [
['middleware::api:Permission', { check: 'v1:settings:update' }],
'controller::api:v1:Settings.update_setting',
],
},
}
module.exports = exports = settings_routes