Skip to content

Commit b4435e1

Browse files
committed
changed logic for check pro user response
1 parent 96261b5 commit b4435e1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

forms/forms-routes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ const Fields = require('../form_fields/form-fields-model.js')
88
router.post('/:userId', async (req, res) => {
99
const status = await Forms.getStatus(req.params.userId)
1010
console.log(status, 'status')
11-
const count = await Forms.getFormCount(req.params.userId)
11+
let count = await Forms.getFormCount(req.params.userId)
1212
count = parseInt(count.count, 10)
1313
console.log(count, 'count')
1414

1515
if (status.pro == false && count >= 3) {
16-
res.status(406).json({
16+
res.status(200).json({
1717
message: 'Upgrade account to pro for more forms',
1818
pro: status.pro,
1919
form_count: count

user/user-routes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ router.get('/upgrade/:id', async (req, res) => {
8989
console.log(count, 'count')
9090

9191
if (status.pro == false && count >= 3) {
92-
res.status(406).json({
92+
res.status(200).json({
9393
message: 'Upgrade account to pro for more forms',
9494
pro: status.pro,
9595
form_count: count

0 commit comments

Comments
 (0)