diff --git a/server/controllers/routes/user/project/getProjectsByType.js b/server/controllers/routes/user/project/getProjectsByType.js index 013409e0..7d074185 100644 --- a/server/controllers/routes/user/project/getProjectsByType.js +++ b/server/controllers/routes/user/project/getProjectsByType.js @@ -11,7 +11,7 @@ const getProjectsData = async (req, res, next) => { if (rows.length > 0) { res.json({ statusCode: 200, - rows, + data: rows, }); } else { res.json({ diff --git a/test/index.test.js b/test/index.test.js index 5172297a..07705b45 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -182,7 +182,7 @@ describe('Get project by type', () => { .expect('Content-Type', /json/) .end((err, res) => { if (err) return done(err); - const { name } = res.body.rows[0]; + const { name } = res.body.data[0]; expect(name).toBe('Applicants System'); done(); });