idurar / idurar-erp-crm

Free Open Source ERP CRM Accounting Invoicing Software | Node Js React
https://cloud.idurarapp.com
GNU Affero General Public License v3.0
6.25k stars 1.88k forks source link

fix(backend) Update dependencies and add helmet #1129

Open Fcmam5 opened 3 months ago

Fcmam5 commented 3 months ago

For the future:

Return less verbose errors, now the API returns this for example:

{
  "success": false,
  "result": null,
  "message": "Cannot read properties of undefined (reading 'replace')",
  "error": {},
  "controller": "isValidAuthToken"
}

Also, responses are returning non-mapped objects, e.g:

{
  "success": true,
  "result": {
    "_id": "XXX",
    "removed": false,
    "enabled": true,
    "account": "XXX",
    "branch": "XXX",
    "settingCategory": "email_settings",
    "settingKey": "email_reply_to",
    "settingValue": "reply@idurarapp.com",
    "valueType": "string",
    "isPrivate": false,
    "isCoreSetting": false,
    "__v": 0
  },
  "message": "we found this document "
}

I think this should only return what clients need