fix linting errors that are fixable with --fix in server side code
This commit is contained in:
parent
449e103fc6
commit
af3cb60ce1
13 changed files with 91 additions and 92 deletions
server
|
@ -11,7 +11,7 @@ export function signS3(req, res) {
|
||||||
filename = uuid.v4() + fileExtension,
|
filename = uuid.v4() + fileExtension,
|
||||||
acl = 'public-read',
|
acl = 'public-read',
|
||||||
p = policy({
|
p = policy({
|
||||||
acl: acl,
|
acl,
|
||||||
secret: process.env.AWS_SECRET_KEY,
|
secret: process.env.AWS_SECRET_KEY,
|
||||||
length: 5000000, // in bytes?
|
length: 5000000, // in bytes?
|
||||||
bucket: process.env.S3_BUCKET,
|
bucket: process.env.S3_BUCKET,
|
||||||
|
@ -25,4 +25,4 @@ export function signS3(req, res) {
|
||||||
'signature': p.signature
|
'signature': p.signature
|
||||||
};
|
};
|
||||||
return res.json(result);
|
return res.json(result);
|
||||||
};
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ function deleteChild(files, parentId, id) {
|
||||||
files = files.map((file) => {
|
files = files.map((file) => {
|
||||||
if (file.id === parentId) {
|
if (file.id === parentId) {
|
||||||
file.children = file.children.filter(child => child !== id);
|
file.children = file.children.filter(child => child !== id);
|
||||||
return file
|
return file;
|
||||||
}
|
}
|
||||||
return file;
|
return file;
|
||||||
});
|
});
|
||||||
|
@ -63,7 +63,7 @@ export function deleteFile(req, res) {
|
||||||
// project.files.id(req.query.parentId).children = childrenArray.filter(id => id !== req.params.file_id);
|
// project.files.id(req.query.parentId).children = childrenArray.filter(id => id !== req.params.file_id);
|
||||||
project.save(innerErr => {
|
project.save(innerErr => {
|
||||||
res.json(project.files);
|
res.json(project.files);
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,6 @@ export function getProjects(req, res) {
|
||||||
// could just move this to client side
|
// could just move this to client side
|
||||||
return res.json([]);
|
return res.json([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getProjectsForUser(req, res) {
|
export function getProjectsForUser(req, res) {
|
||||||
|
|
|
@ -74,7 +74,7 @@ export function updatePreferences(req, res) {
|
||||||
|
|
||||||
return res.json(user.preferences);
|
return res.json(user.preferences);
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function resetPasswordInitiate(req, res) {
|
export function resetPasswordInitiate(req, res) {
|
||||||
|
|
|
@ -9,7 +9,7 @@ const defaultSketch = `function setup() {
|
||||||
}
|
}
|
||||||
function draw() {
|
function draw() {
|
||||||
background(220);
|
background(220);
|
||||||
}`
|
}`;
|
||||||
|
|
||||||
const defaultHTML =
|
const defaultHTML =
|
||||||
`<!DOCTYPE html>
|
`<!DOCTYPE html>
|
||||||
|
@ -24,7 +24,7 @@ const defaultHTML =
|
||||||
<script src="sketch.js"></script>
|
<script src="sketch.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
`
|
`;
|
||||||
const defaultCSS =
|
const defaultCSS =
|
||||||
`html, body {
|
`html, body {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Router } from 'express';
|
import { Router } from 'express';
|
||||||
const router = new Router();
|
const router = new Router();
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { renderIndex } from '../views/index'
|
import { renderIndex } from '../views/index';
|
||||||
|
|
||||||
// this is intended to be a temporary file
|
// this is intended to be a temporary file
|
||||||
// until i figure out isomorphic rendering
|
// until i figure out isomorphic rendering
|
||||||
|
|
|
@ -93,7 +93,7 @@ export function resolveStyles(sketchDoc, files, projectId) {
|
||||||
} else {
|
} else {
|
||||||
const style = sketchDoc.createElement('style');
|
const style = sketchDoc.createElement('style');
|
||||||
style.innerHTML = `\n${resolvedFile.content}`;
|
style.innerHTML = `\n${resolvedFile.content}`;
|
||||||
sketchDoc.getElementsByTagName("head")[0].appendChild(style);
|
sketchDoc.getElementsByTagName('head')[0].appendChild(style);
|
||||||
css.parentNode.removeChild(css);
|
css.parentNode.removeChild(css);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue