File tree Expand file tree Collapse file tree
server/controllers/project.controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,11 +6,7 @@ import {
66} from '../../domain-objects/Project' ;
77
88export default function createProject ( req , res ) {
9- let projectValues = {
10- user : req . user . _id
11- } ;
12-
13- projectValues = Object . assign ( projectValues , req . body ) ;
9+ const projectValues = Object . assign ( { } , req . body , { user : req . user . _id } ) ;
1410
1511 function sendFailure ( err ) {
1612 res . status ( 400 ) . json ( { success : false } ) ;
@@ -32,7 +28,7 @@ export default function createProject(req, res) {
3228
3329// TODO: What happens if you don't supply any files?
3430export async function apiCreateProject ( req , res ) {
35- const params = Object . assign ( { user : req . user . _id } , req . body ) ;
31+ const params = Object . assign ( { } , req . body , { user : req . user . _id } ) ;
3632
3733 const sendValidationErrors = ( err , type , code = 422 ) => {
3834 res . status ( code ) . json ( {
You can’t perform that action at this time.
0 commit comments