fix: workflow delete error (#2879)

* fix: workflow delete key error

* fix: chat auth error
This commit is contained in:
Archer
2024-10-10 19:31:51 +08:00
committed by GitHub
parent 27291faa66
commit 02bcab8802
7 changed files with 62 additions and 73 deletions

View File

@@ -44,6 +44,7 @@ async function handler(
per: ReadPermissionVal
})
]);
if (!app) {
return Promise.reject(AppErrEnum.unExist);
}

View File

@@ -37,7 +37,7 @@ async function handler(
// auth chat permission
if (chat && !app.permission.hasManagePer && String(tmbId) !== String(chat?.tmbId)) {
throw new Error(ChatErrEnum.unAuthChat);
return Promise.reject(ChatErrEnum.unAuthChat);
}
// get app and history

View File

@@ -32,7 +32,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
// auth chat permission
if (chat && chat.outLinkUid !== uid) {
throw new Error(ChatErrEnum.unAuthChat);
return Promise.reject(ChatErrEnum.unAuthChat);
}
const { nodes, chatConfig } = await getAppLatestVersion(app._id, app);

View File

@@ -37,7 +37,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
// auth chat permission
if (chat && chat.outLinkUid !== uid) {
throw new Error(ChatErrEnum.unAuthChat);
return Promise.reject(ChatErrEnum.unAuthChat);
}
// get app and history