diff --git a/server/models/project.js b/server/models/project.js index 7e82790..7ece811 100644 --- a/server/models/project.js +++ b/server/models/project.js @@ -41,7 +41,7 @@ var ProjectSchema = new mongoose.Schema({ priority: { type: Number, }, - status: { + statusproj: { type: Number, default: 0 }, diff --git a/server/models/todo.js b/server/models/todo.js index 279d992..5d2749d 100644 --- a/server/models/todo.js +++ b/server/models/todo.js @@ -32,7 +32,7 @@ var TodoSchema = new mongoose.Schema({ priority: { type: Number, }, - status: { + statustodo: { type: Number, default: 0 }, diff --git a/server/tests/seed/seed.js b/server/tests/seed/seed.js index 695e9c2..009c452 100644 --- a/server/tests/seed/seed.js +++ b/server/tests/seed/seed.js @@ -75,7 +75,7 @@ const userjson = JSON.stringify(users[0]); const todos = [{ _id: new ObjectID(), category: "personal", - status: 0, + statustodo: 0, completed_at: new Date(), created_at: new Date(), descr: "Primo Task Esempio", @@ -91,7 +91,7 @@ const todos = [{ }, { _id: new ObjectID(), category: "personal", - status: 0, + statustodo: 0, completed_at: new Date(), created_at: new Date(), descr: "Secondo Task Esempio", @@ -107,7 +107,7 @@ const todos = [{ }, { _id: new ObjectID(), category: "personal", - status: 0, + statustodo: 0, completed_at: new Date(), created_at: new Date(), descr: "Terzo Task Esempio", @@ -123,7 +123,7 @@ const todos = [{ }, { // RECORD CHE VERRA' UTILIZZATO PER AGGIUNGERE UN NUOVO TASK _id: new ObjectID(), category: "personal", - status: 0, + statustodo: 0, completed_at: new Date(), created_at: new Date(), descr: "Nuovo Quarto Task Esempio da Inserire", diff --git a/server/tests/server.test.js b/server/tests/server.test.js index 617d4f1..15c5b01 100644 --- a/server/tests/server.test.js +++ b/server/tests/server.test.js @@ -327,7 +327,7 @@ if (testsingolo) { .set('x-auth', users[0].tokens[0].token) .expect(404) .expect((res) => { - console.log('res', res.status) + console.log('res', res.statustodo); expect(res.body.todos).toBe(undefined); }) .end(done); @@ -393,13 +393,13 @@ if (testsingolo) { .patch(`/todos/${hexId}`) .set('x-auth', users[0].tokens[0].token) .send({ - status: 1, + statustodo: 1, descr }) .expect(200) .expect((res) => { expect(res.body.todo.descr).toBe(descr); - expect(res.body.todo.status).toBe(1); + expect(res.body.todo.statustodo).toBe(1); // expect(res.body.todo.completedAt).toBeA('number'); }) .end(done); @@ -413,7 +413,7 @@ if (testsingolo) { .patch(`/todos/${hexId}`) .set('x-auth', users[1].tokens[0].token) .send({ - status: 1, + statustodo: 1, descr }) .expect(404) diff --git a/server/tools/general.js b/server/tools/general.js index 04a9290..1d482f8 100644 --- a/server/tools/general.js +++ b/server/tools/general.js @@ -51,7 +51,7 @@ module.exports = { }, allfieldTodo: function () { - return ['userId', 'pos', 'category', 'descr', 'priority', 'status', 'created_at', 'modify_at', + return ['userId', 'pos', 'category', 'descr', 'priority', 'statustodo', 'created_at', 'modify_at', 'completed_at', 'expiring_at', 'enableExpiring', 'id_prev', 'progress', 'modified', 'phase', 'assigned_to_userId', 'hoursplanned', 'hoursworked', 'start_date'] }, @@ -61,7 +61,7 @@ module.exports = { // #TODO Projects++ Add fields ... allfieldProject: function () { - return ['userId', 'pos', 'id_parent', 'descr', 'longdescr', 'hoursplanned', 'hoursworked', 'priority', 'status', 'created_at', 'modify_at', + return ['userId', 'pos', 'id_parent', 'descr', 'longdescr', 'hoursplanned', 'hoursworked', 'priority', 'statusproj', 'created_at', 'modify_at', 'completed_at', 'expiring_at', 'enableExpiring', 'id_prev', 'progressCalc', 'modified', 'live_url', 'test_url', 'begin_development', 'begin_test'] },