Spaces:
Running
Running
Update app.js
Browse files
app.js
CHANGED
|
@@ -137,6 +137,7 @@ app.post('/onboarding/create', validateRequest, async (req, res) => {
|
|
| 137 |
|
| 138 |
if (isFailure) {
|
| 139 |
console.log(`[Onboarding] ❌ Project Failed Grading. Skipping Image.`);
|
|
|
|
| 140 |
} else {
|
| 141 |
console.log(`[Onboarding] ✅ Passed. Generating Thumbnail...`);
|
| 142 |
const imagePrompt = `Game Title: ${grading.title}. Core Concept: ${description}`;
|
|
@@ -170,7 +171,7 @@ app.post('/onboarding/create', validateRequest, async (req, res) => {
|
|
| 170 |
}
|
| 171 |
|
| 172 |
const timestamp = Date.now();
|
| 173 |
-
const status = isFailure ? "rejected" : "
|
| 174 |
|
| 175 |
// 1. Prepare Memory Object
|
| 176 |
// Note: storing URL instead of raw Base64 now
|
|
@@ -191,7 +192,7 @@ app.post('/onboarding/create', validateRequest, async (req, res) => {
|
|
| 191 |
};
|
| 192 |
|
| 193 |
// 2. FIRESTORE WRITE (Project Indexing)
|
| 194 |
-
if (firestore) {
|
| 195 |
try {
|
| 196 |
await firestore.collection('projects').doc(projectId).set({
|
| 197 |
id: projectId,
|
|
@@ -206,7 +207,7 @@ app.post('/onboarding/create', validateRequest, async (req, res) => {
|
|
| 206 |
}
|
| 207 |
|
| 208 |
// 3. REALTIME DB WRITE (Deep State)
|
| 209 |
-
if (db) {
|
| 210 |
const updates = {};
|
| 211 |
|
| 212 |
// Bucket 1: Info (Lightweight)
|
|
|
|
| 137 |
|
| 138 |
if (isFailure) {
|
| 139 |
console.log(`[Onboarding] ❌ Project Failed Grading. Skipping Image.`);
|
| 140 |
+
|
| 141 |
} else {
|
| 142 |
console.log(`[Onboarding] ✅ Passed. Generating Thumbnail...`);
|
| 143 |
const imagePrompt = `Game Title: ${grading.title}. Core Concept: ${description}`;
|
|
|
|
| 171 |
}
|
| 172 |
|
| 173 |
const timestamp = Date.now();
|
| 174 |
+
const status = isFailure ? "rejected" : "Idle";
|
| 175 |
|
| 176 |
// 1. Prepare Memory Object
|
| 177 |
// Note: storing URL instead of raw Base64 now
|
|
|
|
| 192 |
};
|
| 193 |
|
| 194 |
// 2. FIRESTORE WRITE (Project Indexing)
|
| 195 |
+
if (firestore && !isFailure) {
|
| 196 |
try {
|
| 197 |
await firestore.collection('projects').doc(projectId).set({
|
| 198 |
id: projectId,
|
|
|
|
| 207 |
}
|
| 208 |
|
| 209 |
// 3. REALTIME DB WRITE (Deep State)
|
| 210 |
+
if (db && !isFailure) {
|
| 211 |
const updates = {};
|
| 212 |
|
| 213 |
// Bucket 1: Info (Lightweight)
|