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

36 lines
986 B
JavaScript
Raw Normal View History

2020-05-04 01:16:54 +00:00
const profile_routes = {
prefix: '/api/v1/profile',
middleware: [
'auth:APIRoute',
2020-05-04 01:16:54 +00:00
],
get: {
'/:user_id': [ // user_id | 'me'
['middleware::api:Permission', { check: 'v1:profile:get' }],
2020-05-04 01:16:54 +00:00
'controller::api:v1:Profile.fetch',
],
'/:user_id/photo': [
['middleware::api:Permission', { check: 'v1:profile:photo:get' }],
'controller::api:v1:Profile.get_photo',
],
},
post: {
'/:user_id/photo': [
['middleware::api:Permission', { check: 'v1:profile:photo:update' }],
['middleware::upload:UploadFile', { tag: 'v1:profile:photo' }],
'controller::api:v1:Profile.update_photo',
],
2020-05-04 01:16:54 +00:00
},
patch: {
'/:user_id': [ // user_id | 'me'
['middleware::api:Permission', { check: 'v1:profile:update' }],
2020-05-04 01:16:54 +00:00
'controller::api:v1:Profile.update',
],
},
}
module.exports = exports = profile_routes