Let the human ignore an open question in a transcript
This commit is contained in:
@@ -177,6 +177,24 @@ func (s *Store) WithdrawItem(ctx context.Context, id string) error {
|
||||
})
|
||||
}
|
||||
|
||||
func (s *Store) DismissItem(ctx context.Context, id, actor string) error {
|
||||
return s.write(ctx, func(tx *sql.Tx, emit emitFunc) error {
|
||||
res, err := tx.ExecContext(ctx, `UPDATE inbox_items SET state = ?, resolved_by = ?, resolved_at = ? WHERE id = ? AND state = ?`,
|
||||
string(api.Dismissed), actor, now(), id, string(api.Open))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
n, err := res.RowsAffected()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if n == 0 {
|
||||
return ErrNotOpen
|
||||
}
|
||||
return emitItem(ctx, tx, emit, "inbox.updated", id, actor)
|
||||
})
|
||||
}
|
||||
|
||||
func dismissTaskInbox(ctx context.Context, tx *sql.Tx, emit emitFunc, taskID, actor string) error {
|
||||
ids := []string{}
|
||||
rows, err := tx.QueryContext(ctx, `SELECT id FROM inbox_items WHERE task_id = ? AND state = ?`, taskID, string(api.Open))
|
||||
|
||||
Reference in New Issue
Block a user