2020-05-04 01:16:54 +00:00
|
|
|
const profile_routes = {
|
|
|
|
prefix: '/api/v1/profile',
|
|
|
|
|
|
|
|
middleware: [
|
2020-05-17 04:55:08 +00:00
|
|
|
'auth:APIRoute',
|
2020-05-04 01:16:54 +00:00
|
|
|
],
|
|
|
|
|
|
|
|
get: {
|
|
|
|
'/:user_id': [ // user_id | 'me'
|
2020-05-17 04:55:08 +00:00
|
|
|
['middleware::api:Permission', { check: 'v1:profile:get' }],
|
2020-05-04 01:16:54 +00:00
|
|
|
'controller::api:v1:Profile.fetch',
|
|
|
|
],
|
2020-05-19 03:55:08 +00:00
|
|
|
'/: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'
|
2020-05-17 04:55:08 +00:00
|
|
|
['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
|