️ 优化操作逻辑

This commit is contained in:
目棃
2024-03-23 14:23:43 +08:00
parent 7f872787f1
commit 55671ab22d
2 changed files with 30 additions and 4 deletions

View File

@@ -114,6 +114,18 @@ async function deleteCollect(title: string, force: boolean): Promise<boolean> {
return true;
}
/**
* @description 删除未分类帖子
* @since Beta v0.4.5
* @return {Promise<boolean>} 返回是否删除成功
*/
async function deleteUnCollectPost(): Promise<boolean> {
const db = await TGSqlite.getDB();
const sql = "DELETE FROM UFPost WHERE id NOT IN (SELECT postId FROM UFMap)";
await db.execute(sql);
return true;
}
/**
* @description 更新收藏合集信息,标题/描述
* @since Beta v0.4.5
@@ -365,6 +377,7 @@ const TSUserCollection = {
getUnCollectPostList,
createCollect,
deleteCollect,
deleteUnCollectPost,
updateCollect,
addCollect,
updatePostInfo,