@xuda.io/account_module 1.2.1542 → 1.2.1543

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.
Files changed (2) hide show
  1. package/index.mjs +5 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -3056,11 +3056,14 @@ export const record_ai_credit = async function (uid, credits = 0, source, detail
3056
3056
  credited_uid,
3057
3057
  details,
3058
3058
  },
3059
- fields: ['message.seq'],
3059
+ fields: ['_id'],
3060
3060
  limit: 1,
3061
- sort: [{ 'message.seq': 'desc' }],
3062
3061
  });
3063
3062
 
3063
+ if (dup.docs.length) {
3064
+ throw new Error(`${details} already credited!`);
3065
+ }
3066
+
3064
3067
  const t = Date.now();
3065
3068
  let credit_doc = {
3066
3069
  _id: await _common.xuda_get_uuid('ai_credit'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1542",
3
+ "version": "1.2.1543",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {