From 8b7b49f72a6c744683d4d8dd73943dcf45066d36 Mon Sep 17 00:00:00 2001 From: Paulo Jorge Reis Date: Wed, 17 Apr 2019 11:11:44 +0100 Subject: [PATCH] Merge pull request #1693 from sharelatex/cmg-clone-owners Return new project data from api when cloning GitOrigin-RevId: 726ee5a37a7f74f2f618ca911ae9c2c991f12786 --- .../web/app/coffee/Features/Project/ProjectController.coffee | 2 +- services/web/public/src/main/project-list/project-list.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/web/app/coffee/Features/Project/ProjectController.coffee b/services/web/app/coffee/Features/Project/ProjectController.coffee index 246a9e646e..6063041f1a 100644 --- a/services/web/app/coffee/Features/Project/ProjectController.coffee +++ b/services/web/app/coffee/Features/Project/ProjectController.coffee @@ -124,7 +124,7 @@ module.exports = ProjectController = if err? logger.error err:err, project_id: project_id, user_id: currentUser._id, "error cloning project" return next(err) - res.send(project_id:project._id) + res.send({name:project.name, project_id:project._id, owner_ref:project.owner_ref}) newProject: (req, res, next)-> diff --git a/services/web/public/src/main/project-list/project-list.js b/services/web/public/src/main/project-list/project-list.js index e27ec90003..b6cace7f33 100644 --- a/services/web/public/src/main/project-list/project-list.js +++ b/services/web/public/src/main/project-list/project-list.js @@ -575,11 +575,11 @@ define(['base', 'main/project-list/services/project-list'], function(App) { .then(function(response) { const { data } = response $scope.projects.push({ - name: cloneName, + name: data.name, id: data.project_id, accessLevel: 'owner', owner: { - _id: user_id + _id: data.owner_ref } // TODO: Check access level if correct after adding it in // to the rest of the app