Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reactivate #20

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions elevate-mentoring/constants/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,17 @@ module.exports = {
functionName: 'updateUser',
},
},
{
sourceRoute: '/interface/v1/account/reActivate',
type: 'POST',
inSequence: false,
orchestrated: true,
targetRoute: {
path: '/mentoring/v1/profile/reActivate',
type: 'POST',
functionName: 'reActivate',
},
},
{
sourceRoute: '/interface/v1/entity-type/read',
type: 'POST',
Expand Down
7 changes: 7 additions & 0 deletions elevate-mentoring/controllers/mentoring.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ const createProfile = async (req, res, responses) => {
'X-auth-token': `bearer ${responses.user.result.access_token}`,
})
}
const reActivate = async (req, res, responses) => {
const selectedConfig = routeConfigs.routes.find((obj) => obj.sourceRoute === req.sourceRoute)
return await requesters.post(req.baseUrl, selectedConfig.targetRoute.path, req.body, {
'X-auth-token': `bearer ${responses.user.result.access_token}`,
})
}
const updateUser = async (req, res, responses) => {
const selectedConfig = routeConfigs.routes.find((obj) => obj.sourceRoute === req.sourceRoute)

Expand All @@ -25,6 +31,7 @@ const entityTypeRead = async (req, res, responses) => {

mentoringController = {
createProfile,
reActivate,
updateUser,
entityTypeRead,
}
Expand Down
22 changes: 22 additions & 0 deletions elevate-user/constants/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,28 @@ module.exports = {
functionName: 'updateUser',
},
},
{
sumanvpacewisdom marked this conversation as resolved.
Show resolved Hide resolved
sourceRoute: '/interface/v1/account/reActivate',
type: 'POST',
inSequence: true,
orchestrated: true,
targetRoute: {
path: '/user/v1/account/reActivate',
type: 'POST',
functionName: 'reActivateAccount',
},
},
{
sourceRoute: '/user/v1/account/reActivateOtp',
type: 'POST',
inSequence: false,
orchestrated: false,
targetRoute: {
path: '/user/v1/account/reActivateOtp',
type: 'POST',
functionName: 'reActivateAccount',
sumanvpacewisdom marked this conversation as resolved.
Show resolved Hide resolved
},
},
{
sourceRoute: '/interface/user-signup',
type: 'POST',
Expand Down
5 changes: 5 additions & 0 deletions elevate-user/controllers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ const createUser = async (req, res, responses) => {
const selectedConfig = routeConfigs.routes.find((obj) => obj.sourceRoute === req.sourceRoute)
return await requesters.post(req.baseUrl, selectedConfig.targetRoute.path, req.body)
}
const reActivateAccount = async (req, res, response) => {
const selectedConfig = routeConfigs.routes.find((obj) => obj.sourceRoute === req.sourceRoute)
return await requesters.post(req.baseUrl, selectedConfig.targetRoute.path, req.body)
}
const updateUser = async (req, res, responses) => {
const selectedConfig = routeConfigs.routes.find((obj) => obj.sourceRoute === req.sourceRoute)

Expand All @@ -22,6 +26,7 @@ const entityTypeRead = async (req, res, responses) => {

const userController = {
createUser,
reActivateAccount,
updateUser,
entityTypeRead,
}
Expand Down