diff --git a/api/review.go b/api/review.go index 7c39f61f..3188dc6c 100644 --- a/api/review.go +++ b/api/review.go @@ -14,12 +14,12 @@ import ( nhttp "github.com/Gleipnir-Technology/nidus-sync/http" "github.com/aarondl/opt/omit" "github.com/aarondl/opt/omitnull" + "github.com/rs/zerolog/log" /* "github.com/Gleipnir-Technology/bob/dialect/psql/sm" "github.com/Gleipnir-Technology/nidus-sync/platform/geom" "github.com/aarondl/opt/omit" "github.com/aarondl/opt/omitnull" - "github.com/rs/zerolog/log" "github.com/stephenafamo/scan" */) @@ -74,6 +74,7 @@ func postReviewPool(ctx context.Context, r *http.Request, org *models.Organizati return nil, e } txn.Commit(ctx) + log.Info().Int32("id", review_task.ID).Str("status", req.Status).Msg("committed") return &createdReviewPool{}, e } func discardReviewPool(ctx context.Context, txn bob.Tx, user *models.User, req createReviewPool, review_task_pool *models.ReviewTaskPool) *nhttp.ErrorWithStatus { @@ -121,7 +122,7 @@ func commitReviewPool(ctx context.Context, txn bob.Tx, user *models.User, req cr ), psql.Arg(4326), ), ), - um.Where(psql.Quote("review_task_pool", "id").EQ(psql.Arg(review_task_pool.ReviewTaskID))), + um.Where(psql.Quote("review_task_pool", "review_task_id").EQ(psql.Arg(review_task_pool.ReviewTaskID))), ).Exec(ctx, txn) if err != nil { return nhttp.NewError("save task: %w", err) diff --git a/html/template/sync/review/pool.html b/html/template/sync/review/pool.html index ee48011d..c2475131 100644 --- a/html/template/sync/review/pool.html +++ b/html/template/sync/review/pool.html @@ -206,12 +206,12 @@ try { const payload = { task_id: this.selectedTask.id, - status: action, // 'reviewed' or 'discarded' + status: action, // 'committed' or 'discarded' updates: {}, }; // Include changed fields in the payload - if (action === "reviewed") { + if (action === "committed") { Object.keys(this.form).forEach((key) => { if (this.form[key] !== this.originalValues[key]) { payload.updates[key] = this.form[key];