summaryrefslogtreecommitdiffstats
path: root/models/import.js
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-10-14 23:50:12 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-10-14 23:50:12 +0200
commit944a1065d372095e8a0898a4162ca6bb562bab69 (patch)
treef179e744acc7adfe7d2354ce0127daadb6e4104f /models/import.js
parent43de3b8a01b001ec665294fa8bd75f5d01df7df0 (diff)
downloadwekan-944a1065d372095e8a0898a4162ca6bb562bab69.tar.gz
wekan-944a1065d372095e8a0898a4162ca6bb562bab69.tar.bz2
wekan-944a1065d372095e8a0898a4162ca6bb562bab69.zip
Add some ESLint rules and fix some related issues
Diffstat (limited to 'models/import.js')
-rw-r--r--models/import.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/models/import.js b/models/import.js
index 51206ea3..4fe4b478 100644
--- a/models/import.js
+++ b/models/import.js
@@ -1,7 +1,7 @@
Meteor.methods({
importTrelloCard(trelloCard, listId, sortIndex) {
// 1. check parameters are ok from a syntax point of view
- DateString = Match.Where(function (dateAsString) {
+ const DateString = Match.Where(function (dateAsString) {
check(dateAsString, String);
return moment(dateAsString, moment.ISO_8601).isValid();
});
@@ -25,9 +25,6 @@ Meteor.methods({
check(listId, String);
check(sortIndex, Number);
} catch(e) {
- if(Meteor.isServer) {
- console.log(e);
- }
throw new Meteor.Error('error-json-schema');
}
@@ -59,7 +56,9 @@ Meteor.methods({
};
// 4. find actual creation date
- const creationAction = trelloCard.actions.find((action) => {return action.type === 'createCard';});
+ const creationAction = trelloCard.actions.find((action) => {
+ return action.type === 'createCard';
+ });
if(creationAction) {
cardToCreate.createdAt = creationAction.date;
}
@@ -92,7 +91,7 @@ Meteor.methods({
Activities.direct.insert({
activityType: 'importCard',
boardId: cardToCreate.boardId,
- cardId: cardId,
+ cardId,
createdAt: dateOfImport,
listId: cardToCreate.listId,
source: {
@@ -109,7 +108,7 @@ Meteor.methods({
if(currentAction.type === 'commentCard') {
const commentToCreate = {
boardId: list.boardId,
- cardId: cardId,
+ cardId,
createdAt: currentAction.date,
text: currentAction.data.text,
// XXX use the original comment user instead
@@ -120,7 +119,7 @@ Meteor.methods({
activityType: 'addComment',
boardId: commentToCreate.boardId,
cardId: commentToCreate.cardId,
- commentId: commentId,
+ commentId,
createdAt: commentToCreate.createdAt,
userId: commentToCreate.userId,
});