@xuda.io/ai_module 1.1.4159 → 1.1.4160
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/index.mjs +4 -4
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1960,7 +1960,7 @@ export const archive_ai_chat = async function (req) {
|
|
|
1960
1960
|
await team_module.validate_share_exist(uid, 'chat', conversation_id);
|
|
1961
1961
|
|
|
1962
1962
|
let conversation_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_id);
|
|
1963
|
-
|
|
1963
|
+
|
|
1964
1964
|
if (conversation_doc.uid !== uid && conversation_doc?.account_profile_info?.account_profile_obj?.shared_from_uid !== uid) {
|
|
1965
1965
|
throw new Error('Operation not allowed');
|
|
1966
1966
|
}
|
|
@@ -1977,10 +1977,10 @@ export const archive_ai_chat = async function (req) {
|
|
|
1977
1977
|
|
|
1978
1978
|
export const unarchive_ai_chat = async function (req) {
|
|
1979
1979
|
let { conversation_id, uid } = req;
|
|
1980
|
-
|
|
1980
|
+
const account_profile_info = await account_module.get_active_account_profile_info(uid);
|
|
1981
1981
|
const app_id = await account_module.get_account_default_project_id(uid);
|
|
1982
1982
|
try {
|
|
1983
|
-
let conversation_doc = await db_module.get_app_couch_doc_native(app_id, conversation_id);
|
|
1983
|
+
let conversation_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_id);
|
|
1984
1984
|
|
|
1985
1985
|
if (conversation_doc.stat !== 5) {
|
|
1986
1986
|
throw new Error('chat is not archived');
|
|
@@ -1988,7 +1988,7 @@ export const unarchive_ai_chat = async function (req) {
|
|
|
1988
1988
|
|
|
1989
1989
|
conversation_doc.stat = 3;
|
|
1990
1990
|
conversation_doc.ts = Date.now();
|
|
1991
|
-
const save_ret = await db_module.save_app_couch_doc(app_id, conversation_doc);
|
|
1991
|
+
const save_ret = await db_module.save_app_couch_doc(account_profile_info.app_id, conversation_doc);
|
|
1992
1992
|
|
|
1993
1993
|
return save_ret;
|
|
1994
1994
|
} catch (err) {
|