36 lines
986 B
JavaScript
36 lines
986 B
JavaScript
const profile_routes = {
|
|
prefix: '/api/v1/profile',
|
|
|
|
middleware: [
|
|
'auth:APIRoute',
|
|
],
|
|
|
|
get: {
|
|
'/:user_id': [ // user_id | 'me'
|
|
['middleware::api:Permission', { check: 'v1:profile:get' }],
|
|
'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',
|
|
],
|
|
},
|
|
|
|
patch: {
|
|
'/:user_id': [ // user_id | 'me'
|
|
['middleware::api:Permission', { check: 'v1:profile:update' }],
|
|
'controller::api:v1:Profile.update',
|
|
],
|
|
},
|
|
}
|
|
|
|
module.exports = exports = profile_routes
|