fix: 修复账单删除功能并支持分析页面删除操作
Some checks are pending
Deploy BillAI / Deploy to Production (push) Waiting to run
Some checks are pending
Deploy BillAI / Deploy to Production (push) Waiting to run
- 将删除接口从 DELETE /api/bills/:id 改为 POST /api/bills/:id/delete 以兼容 SvelteKit 代理 - 分析页面组件 (TopExpenses/BillRecordsTable/DailyTrendChart) 支持删除并同步更新统计数据 - Review 接口改为直接查询 MongoDB 而非读取文件 - 软删除时记录 updated_at 时间戳 - 添加 .dockerignore 文件优化构建 - 完善 AGENTS.md 文档
This commit is contained in:
@@ -445,7 +445,12 @@ func (r *Repository) DeleteCleanedBillByID(id string) error {
|
||||
defer cancel()
|
||||
|
||||
filter := bson.M{"_id": oid}
|
||||
update := bson.M{"$set": bson.M{"is_deleted": true}}
|
||||
update := bson.M{
|
||||
"$set": bson.M{
|
||||
"is_deleted": true,
|
||||
"updated_at": time.Now(), // 记录更新时间
|
||||
},
|
||||
}
|
||||
result, err := r.cleanedCollection.UpdateOne(ctx, filter, update)
|
||||
if err != nil {
|
||||
return fmt.Errorf("soft delete bill failed: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user