Spaces:
Running
Running
Update app.js
Browse files
app.js
CHANGED
|
@@ -92,7 +92,13 @@ async function checkMinimumCredits(userId, type = 'basic') {
|
|
| 92 |
const required = type === 'diamond' ? MIN_DIAMOND_REQUIRED : MIN_BASIC_REQUIRED;
|
| 93 |
|
| 94 |
if (credits < required) {
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
}
|
| 97 |
}
|
| 98 |
|
|
|
|
| 92 |
const required = type === 'diamond' ? MIN_DIAMOND_REQUIRED : MIN_BASIC_REQUIRED;
|
| 93 |
|
| 94 |
if (credits < required) {
|
| 95 |
+
|
| 96 |
+
res.status(500).json({
|
| 97 |
+
insufficient: true,
|
| 98 |
+
error:`Insufficient ${type} credits. You have ${credits}, need minimum ${required} to proceed.`;
|
| 99 |
+
|
| 100 |
+
});
|
| 101 |
+
// throw new Error(`Insufficient ${type} credits. You have ${credits}, need minimum ${required} to proceed.`);
|
| 102 |
}
|
| 103 |
}
|
| 104 |
|