mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
Removed v2 calls from views (#7351)
This commit is contained in:
committed by
Matteo Pagliazzi
parent
58b9a08539
commit
425172daae
@@ -1,4 +1,4 @@
|
||||
import { authWithHeaders } from '../../middlewares/api-v3/auth';
|
||||
import { authWithHeaders, authWithSession } from '../../middlewares/api-v3/auth';
|
||||
import _ from 'lodash';
|
||||
import { model as Challenge } from '../../models/challenge';
|
||||
import {
|
||||
@@ -340,7 +340,7 @@ api.getChallenge = {
|
||||
api.exportChallengeCsv = {
|
||||
method: 'GET',
|
||||
url: '/challenges/:challengeId/export/csv',
|
||||
middlewares: [authWithHeaders()],
|
||||
middlewares: [authWithSession],
|
||||
async handler (req, res) {
|
||||
req.checkParams('challengeId', res.t('challengeIdRequired')).notEmpty().isUUID();
|
||||
|
||||
|
||||
@@ -133,11 +133,11 @@ script(type='text/ng-template', id='partials/options.settings.settings.html')
|
||||
.panel-body
|
||||
div(ng-if='user.auth.facebook.id')
|
||||
button.btn.btn-primary(disabled='disabled', ng-if='!user.auth.local.username')=env.t('registeredWithFb')
|
||||
button.btn.btn-danger(ng-click='http("delete","/api/v2/user/auth/social",null,"detachedFacebook")', ng-if='user.auth.local.username')=env.t('detachFacebook')
|
||||
button.btn.btn-danger(ng-click='http("delete", "/api/v3/user/auth/social/facebook", null, "detachedFacebook")', ng-if='user.auth.local.username')=env.t('detachFacebook')
|
||||
hr
|
||||
div(ng-if='!user.auth.local.username')
|
||||
p=env.t('addLocalAuth')
|
||||
form(ng-submit='http("post","/api/v2/register",localAuth,"addedLocalAuth")', ng-init='localAuth={}', name='localAuth', novalidate)
|
||||
form(ng-submit='http("post", "/api/v3/user/auth/local/register", localAuth, "addedLocalAuth")', ng-init='localAuth={}', name='localAuth', novalidate)
|
||||
//-.alert.alert-danger(ng-messages='changeUsername.$error && changeUsername.submitted')=env.t('fillAll')
|
||||
.form-group
|
||||
input.form-control(type='text', placeholder=env.t('username'), ng-model='localAuth.username', required)
|
||||
@@ -218,7 +218,7 @@ script(type='text/ng-template', id='partials/options.settings.promo.html')
|
||||
input.form-control(type='number',ng-model='_codes.count',placeholder="Number of codes to generate (eg, 250)")
|
||||
.form-group
|
||||
button.btn.btn-primary(type='submit')=env.t('generate')
|
||||
a.btn.btn-default(href='/api/v2/coupons?_id={{user._id}}&apiToken={{User.settings.auth.apiToken}}')=env.t('getCodes')
|
||||
a.btn.btn-default(href='/api/v3/coupons?_id={{user._id}}&apiToken={{User.settings.auth.apiToken}}')=env.t('getCodes')
|
||||
|
||||
script(type='text/ng-template', id='partials/options.settings.api.html')
|
||||
.container-fluid
|
||||
|
||||
@@ -55,7 +55,7 @@ script(type='text/ng-template', id='partials/options.social.challenges.detail.ht
|
||||
|
||||
// Member List
|
||||
div(bindonce='challenge', ng-if='challenge.members.length > 0')
|
||||
a.btn.btn-primary.btn-sm.pull-right(ng-href='/api/v2/challenges/{{challenge._id}}/csv')
|
||||
a.btn.btn-primary.btn-sm.pull-right(ng-href='/api/v3/challenges/{{challenge._id}}/export/csv')
|
||||
=env.t('exportChallengeCSV')
|
||||
h3=env.t('hows')
|
||||
menu
|
||||
|
||||
@@ -50,7 +50,7 @@ script(type='text/ng-template', id='partials/options.social.hall.heroes.html')
|
||||
h4 Update Item
|
||||
.form-group.well
|
||||
input.form-control(type='text',placeholder='Path (eg, items.pets.BearCub-Base)',ng-model='hero.itemPath')
|
||||
small.muted Enter the <strong>item path</strong>. E.g., <code>items.pets.BearCub-Zombie</code> or <code>items.gear.owned.head_special_0</code> or <code>items.gear.equipped.head</code>. <a href='/api/v2/content/paths' target='_blank'>See all paths here.</a> When in doubt, ask Tyler.
|
||||
small.muted Enter the <strong>item path</strong>. E.g., <code>items.pets.BearCub-Zombie</code> or <code>items.gear.owned.head_special_0</code> or <code>items.gear.equipped.head</code>. <a href='/api/v3/content' target='_blank'>See all paths here.</a> When in doubt, ask Tyler.
|
||||
br
|
||||
input.form-control(type='text',placeholder='Value (eg, 5)',ng-model='hero.itemVal')
|
||||
small.muted Enter the <strong>item value</strong>. E.g., <code>5</code> or <code>false</code> or <code>head_warrior_3</code> (respectively from above examples).
|
||||
|
||||
Reference in New Issue
Block a user