X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=cmd%2Fweb%2Fjs%2Fapi.js;h=c9b4ef5eda1d87bbecb2d3f93d2ce253f31b7e83;hb=16e43cc77935a979c48e75f1ec8ed792952a4ae8;hp=5c19fdf613fd5d165ec17d75d0cb40222d92fe5c;hpb=2f91f20a8645339385ada602684f4957f20f4da4;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FFront.git diff --git a/cmd/web/js/api.js b/cmd/web/js/api.js index 5c19fdf..c9b4ef5 100644 --- a/cmd/web/js/api.js +++ b/cmd/web/js/api.js @@ -1,6 +1,6 @@ 'use strict'; -var App = require('./app.js'); +import App from './app.js'; var Api = {}; @@ -28,7 +28,7 @@ var ApiEndpoints = { {'name': 'email', 'mandatory': true, 'inquery': true}, {'name': 'password', 'mandatory': true, 'inquery': true} ], - 'buildUrl': function(params) { + 'buildUrl': function() { return '/signup'; } }, @@ -39,10 +39,31 @@ var ApiEndpoints = { {'name': 'email', 'mandatory': true, 'inquery': true}, {'name': 'password', 'mandatory': true, 'inquery': true} ], - 'buildUrl': function(params) { + 'buildUrl': function() { return '/signin'; } }, + 'RESET_PASSWORD': { + 'type': 'POST', + 'auth': false, + 'parameters': [ + {'name': 'email', 'mandatory': true, 'inquery': true}, + ], + 'buildUrl': function() { + return '/passwordreset'; + } + }, + 'CHANGE_PASSWORD': { + 'type': 'POST', + 'auth': false, + 'parameters': [ + {'name': 'token', 'mandatory': true, 'inquery': true}, + {'name': 'password', 'mandatory': true, 'inquery': true}, + ], + 'buildUrl': function() { + return '/changepassword'; + } + }, 'MARKET': { 'type': 'GET', 'auth': true, @@ -80,7 +101,7 @@ var ApiEndpoints = { 'type': 'GET', 'auth': true, 'parameters': [], - 'buildUrl': function(params) { + 'buildUrl': function() { return '/otp/enroll'; } }, @@ -90,7 +111,7 @@ var ApiEndpoints = { 'parameters': [ {'name': 'pass', 'mandatory': true, 'inquery': true}, ], - 'buildUrl': function(params) { + 'buildUrl': function() { return '/otp/validate'; } }, @@ -183,5 +204,5 @@ Api.DoRequest = function(type, url, params, headers, callback) { }); }; -module.exports.Api = Api; +export default Api;