Merge branch 'develop' into feature/mobile-examples
This commit is contained in:
commit
3c28682253
5 changed files with 8 additions and 7 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "p5.js-web-editor",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.7",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "p5.js-web-editor",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.7",
|
||||
"description": "The web editor for p5.js.",
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
|
|
|
@ -30,14 +30,15 @@ export function updateProject(req, res) {
|
|||
$set: req.body
|
||||
},
|
||||
{
|
||||
new: true
|
||||
new: true,
|
||||
runValidators: true
|
||||
}
|
||||
)
|
||||
.populate('user', 'username')
|
||||
.exec((updateProjectErr, updatedProject) => {
|
||||
if (updateProjectErr) {
|
||||
console.log(updateProjectErr);
|
||||
res.json({ success: false });
|
||||
res.status(400).json({ success: false });
|
||||
return;
|
||||
}
|
||||
if (req.body.files && updatedProject.files.length !== req.body.files.length) {
|
||||
|
@ -50,7 +51,7 @@ export function updateProject(req, res) {
|
|||
updatedProject.save((innerErr, savedProject) => {
|
||||
if (innerErr) {
|
||||
console.log(innerErr);
|
||||
res.json({ success: false });
|
||||
res.status(400).json({ success: false });
|
||||
return;
|
||||
}
|
||||
res.json(savedProject);
|
||||
|
|
|
@ -9,7 +9,7 @@ export default function createProject(req, res) {
|
|||
projectValues = Object.assign(projectValues, req.body);
|
||||
|
||||
function sendFailure() {
|
||||
res.json({ success: false });
|
||||
res.status(400).json({ success: false });
|
||||
}
|
||||
|
||||
function populateUserData(newProject) {
|
||||
|
|
|
@ -29,7 +29,7 @@ fileSchema.set('toJSON', {
|
|||
|
||||
const projectSchema = new Schema(
|
||||
{
|
||||
name: { type: String, default: "Hello p5.js, it's the server" },
|
||||
name: { type: String, default: "Hello p5.js, it's the server", maxlength: 128 },
|
||||
user: { type: Schema.Types.ObjectId, ref: 'User' },
|
||||
serveSecure: { type: Boolean, default: false },
|
||||
files: { type: [fileSchema] },
|
||||
|
|
Loading…
Reference in a new issue