@base44-preview/cli 0.0.35-pr.279.377d598 → 0.0.35-pr.279.9e3146c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -226314,13 +226314,13 @@ function createEntityRoutes(db2, logger, remoteProxy, broadcast) {
226314
226314
  cursor3 = cursor3.sort(sortObj);
226315
226315
  }
226316
226316
  if (skip2) {
226317
- const skipNum = parseInt(skip2, 10);
226317
+ const skipNum = Number.parseInt(skip2, 10);
226318
226318
  if (!Number.isNaN(skipNum)) {
226319
226319
  cursor3 = cursor3.skip(skipNum);
226320
226320
  }
226321
226321
  }
226322
226322
  if (limit) {
226323
- const limitNum = parseInt(limit, 10);
226323
+ const limitNum = Number.parseInt(limit, 10);
226324
226324
  if (!Number.isNaN(limitNum)) {
226325
226325
  cursor3 = cursor3.limit(limitNum);
226326
226326
  }
@@ -226354,7 +226354,7 @@ function createEntityRoutes(db2, logger, remoteProxy, broadcast) {
226354
226354
  };
226355
226355
  const inserted = stripInternalFields(await collection.insertAsync(record2));
226356
226356
  emit(appId, entityName, "create", inserted);
226357
- res.status(201).json(stripInternalFields(inserted));
226357
+ res.status(201).json(inserted);
226358
226358
  } catch (error48) {
226359
226359
  logger.error(`Error in POST /${entityName}:`, error48);
226360
226360
  res.status(500).json({ error: "Internal server error" });
@@ -226394,7 +226394,7 @@ function createEntityRoutes(db2, logger, remoteProxy, broadcast) {
226394
226394
  res.status(404).json({ error: `Entity "${entityName}" not found` });
226395
226395
  return;
226396
226396
  }
226397
- const { id: _id, created_date, ...body } = req.body;
226397
+ const { id: _id, created_date: _created_date, ...body } = req.body;
226398
226398
  try {
226399
226399
  const updateData = {
226400
226400
  ...body,
@@ -226430,14 +226430,14 @@ function createEntityRoutes(db2, logger, remoteProxy, broadcast) {
226430
226430
  if (doc2) {
226431
226431
  emit(appId, entityName, "delete", stripInternalFields(doc2));
226432
226432
  }
226433
- res.json({ deleted: numRemoved });
226433
+ res.json({ success: true });
226434
226434
  } catch (error48) {
226435
226435
  logger.error(`Error in DELETE /${entityName}/${id2}:`, error48);
226436
226436
  res.status(500).json({ error: "Internal server error" });
226437
226437
  }
226438
226438
  });
226439
226439
  router.delete("/:entityName", parseBody, async (req, res) => {
226440
- const { appId, entityName } = req.params;
226440
+ const { entityName } = req.params;
226441
226441
  const collection = db2.getCollection(entityName);
226442
226442
  if (!collection) {
226443
226443
  res.status(404).json({ error: `Entity "${entityName}" not found` });
@@ -226445,12 +226445,8 @@ function createEntityRoutes(db2, logger, remoteProxy, broadcast) {
226445
226445
  }
226446
226446
  try {
226447
226447
  const query = req.body || {};
226448
- const docs = await collection.findAsync(query);
226449
226448
  const numRemoved = await collection.removeAsync(query, { multi: true });
226450
- for (const doc2 of docs) {
226451
- emit(appId, entityName, "delete", doc2);
226452
- }
226453
- res.json({ deleted: numRemoved });
226449
+ res.json({ success: true, deleted: numRemoved });
226454
226450
  } catch (error48) {
226455
226451
  logger.error(`Error in DELETE /${entityName}:`, error48);
226456
226452
  res.status(500).json({ error: "Internal server error" });
@@ -230899,4 +230895,4 @@ export {
230899
230895
  CLIExitError
230900
230896
  };
230901
230897
 
230902
- //# debugId=D773996C341F187664756E2164756E21
230898
+ //# debugId=E1D122288EEB194164756E2164756E21