fixing put to get

This commit is contained in:
counter 2023-01-15 22:57:31 -08:00
parent 14be6375be
commit c3d17a9f2d
2 changed files with 4 additions and 4 deletions

6
api.js
View file

@ -218,7 +218,7 @@ async function set_up_api_server(app) {
res.status(200).json({
"success": true,
"result": {
"uri": user.path
"path": user.path
}
}).end();
});
@ -228,7 +228,7 @@ async function set_up_api_server(app) {
*/
app.put(constants.API_BASE_PATH + 'user-path', async (req, res) => {
if(req.body.path instanceof String){
const desiredPath = req.body.path;
const desiredPath = req.body.user_path;
const collisionUser = await Users.findOne({ where: { 'path': desiredPath } });
}else{
return res.status(200).json({
@ -249,7 +249,7 @@ async function set_up_api_server(app) {
res.status(200).json({
"success": true,
"result": {
"uri": user.path
"path": user.path
}
}).end();
});

View file

@ -183,7 +183,7 @@ export default {
}
const res = await api_request.update_user_path(desiredPath);
const user_path = await api_request.get_user_path();
this.user_path = user_path;
this.user_path = user_path.result.path;
if(res.success){
toastr.success('Your user path has been updated.', 'Path Updated');
}else{