Skip to content

Commit 0c68e51

Browse files
author
khanh2906
committed
update v0.6.12 - fix generate controller api
1 parent e424144 commit 0c68e51

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/handlers/generateElements.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ module.exports = {
5757

5858
switch (type) {
5959
case 'api':
60-
controllerCode = controllerCode.replace(/res\.send\("Hello World"\);/g, "res.status(200).sendMessage({msg: 'ok'});");
60+
controllerCode = controllerCode.replace(/res\.send\("Hello World"\);/g, "res.status(200).sendData({msg: 'ok'});");
6161
break;
6262
case 'web':
6363
default:

tests/units/generate-element.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('Element Generator', () => {
3535
module.exports = {
3636
index: async function (req, res, next) {
3737
try {
38-
await res.status(200).sendMessage({ msg: 'ok' });
38+
await res.status(200).sendData({ msg: 'ok' });
3939
} catch(error) {
4040
next(error)
4141
}
@@ -44,7 +44,7 @@ describe('Element Generator', () => {
4444
testFunc1: async function (req, res, next) {
4545
try {
4646
// testFunc1 implementation
47-
await res.status(200).sendMessage({ msg: 'ok' });
47+
await res.status(200).sendData({ msg: 'ok' });
4848
} catch(error) {
4949
next(error)
5050
}
@@ -53,7 +53,7 @@ describe('Element Generator', () => {
5353
testFunc2: async function (req, res, next) {
5454
try {
5555
// testFunc2 implementation
56-
await res.status(200).sendMessage({ msg: 'ok' });
56+
await res.status(200).sendData({ msg: 'ok' });
5757
} catch(error) {
5858
next(error)
5959
}

0 commit comments

Comments
 (0)