diff options
| author | Adam Soltys <[email protected]> | 2023-11-28 17:57:31 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-11-28 17:57:40 +0000 |
| commit | 1158560a7f50fb962c6067e6c9d2d3ff25f6535b (patch) | |
| tree | 3022078ee9fc1a34edb66af48a6690940be32324 | |
| parent | 644a003e4609f610343805a08f1cd5ed81d85b96 (diff) | |
| download | coinos-server-1158560a7f50fb962c6067e6c9d2d3ff25f6535b.tar.gz coinos-server-1158560a7f50fb962c6067e6c9d2d3ff25f6535b.zip | |
check contacts
| -rw-r--r-- | routes/users.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/routes/users.js b/routes/users.js index af9a036d..42538005 100644 --- a/routes/users.js +++ b/routes/users.js @@ -356,9 +356,11 @@ export default { payments.reverse().map(async (id) => await g(`payment:${id}`)) ) ).filter((p) => p.type === types.internal && p.ref)) { - let i = contacts.findIndex(({ id }) => id === ref) + let i = contacts.findIndex((c) => c && c.id === ref); if (~i) contacts.splice(i, 1); - contacts.unshift(await g(`user:${ref}`)); + let u = await g(`user:${ref}`); + if (typeof u === "string") u = await g(`user:${ref}`); + if (u) contacts.unshift(u); } await s(`${id}:contacts`, contacts); |
