remove dead code around syncUserToSubscription (#2122)

GitOrigin-RevId: d489365a4bceb9d675e6a75b25be61baa3aa010e
This commit is contained in:
Timothée Alby 2019-09-04 13:28:45 +02:00 committed by sharelatex
parent dc6e4b3a12
commit 294ce1a13c
3 changed files with 4 additions and 49 deletions

View file

@ -129,28 +129,6 @@ module.exports = AdminController = {
})
},
syncUserToSubscription(req, res) {
const { user_id, subscription_id } = req.body
return RecurlyWrapper.getSubscription(
subscription_id,
{},
(err, subscription) =>
User.findById(user_id, (err, user) =>
SubscriptionHandler.syncSubscriptionToUser(
subscription,
user._id,
function(err) {
logger.log(
{ user_id, subscription_id },
'linked account to subscription'
)
return res.send()
}
)
)
)
},
flushProjectToTpds(req, res) {
return projectEntityHandler.flushProjectToThirdPartyDataStore(
req.body.project_id,

View file

@ -907,11 +907,6 @@ function initialize(webRouter, privateApiRouter, publicApiRouter) {
AuthorizationMiddleware.ensureUserIsSiteAdmin,
AdminController.dissconectAllUsers
)
webRouter.post(
'/admin/syncUserToSubscription',
AuthorizationMiddleware.ensureUserIsSiteAdmin,
AdminController.syncUserToSubscription
)
webRouter.post(
'/admin/flushProjectToTpds',
AuthorizationMiddleware.ensureUserIsSiteAdmin,

View file

@ -40,34 +40,20 @@ block content
input(name="_csrf", type="hidden", value=csrfToken)
button.btn.btn-danger(type="submit") Close Editor
p.small Will stop anyone opening the editor. Will NOT disconnect already connected users.
.row-spaced
form(method='post',action='/admin/dissconectAllUsers')
input(name="_csrf", type="hidden", value=csrfToken)
button.btn.btn-danger(type="submit") Disconnect all users
p.small Will force disconnect all users with the editor open. Make sure to close the editor first to avoid them reconnecting.
tab(heading="Subscriptions")
h3 Link Recurly subscription to user
.row
form.form.col-xs-6(method='post',action='/admin/syncUserToSubscription')
input(name="_csrf", type="hidden", value=csrfToken)
.form-group
label(for='subscription_id') subscription_id (in Recurly)
input.form-control(type='text', name='subscription_id', placeholder='subscription_id', required)
.form-group
label(for='user_id') user_id
input.form-control(type='text', name='user_id', placeholder='user_id', required)
.form-group
button.btn-primary.btn(type='submit') Link
tab(heading="TPDS/Dropbox Management")
h3 Flush project to TPDS
.row
form.col-xs-6(method='post',action='/admin/flushProjectToTpds')
input(name="_csrf", type="hidden", value=csrfToken)
.form-group
label(for='project_id') project_id
label(for='project_id') project_id
input.form-control(type='text', name='project_id', placeholder='project_id', required)
.form-group
button.btn-primary.btn(type='submit') Flush
@ -77,11 +63,7 @@ block content
form.col-xs-6(method='post',action='/admin/pollDropboxForUser')
input(name="_csrf", type="hidden", value=csrfToken)
.form-group
label(for='user_id') user_id
label(for='user_id') user_id
input.form-control(type='text', name='user_id', placeholder='user_id', required)
.form-group
button.btn-primary.btn(type='submit') Poll