Reapply "Build post chat and attachment workflows"
Some checks failed
CI / frontend (push) Has been cancelled
CI / docker (push) Has been cancelled
CI / backend (push) Has been cancelled

This reverts commit 5bc4a551af.
This commit is contained in:
Cauê Faleiros
2026-06-10 09:24:44 -03:00
parent 5bc4a551af
commit 3314c2e863
30 changed files with 3021 additions and 204 deletions

View File

@@ -137,6 +137,26 @@ func (s Store) FindAttachment(ctx context.Context, id string, viewerUserID strin
return scanAttachment(row)
}
func (s Store) DeleteAttachment(ctx context.Context, id string) (Attachment, error) {
row := s.db.QueryRow(ctx, `
DELETE FROM calendar_item_attachments
WHERE id = $1::uuid
RETURNING
id::text,
calendar_item_id::text,
original_filename,
stored_filename,
mime_type,
size_bytes,
storage_driver,
storage_path,
created_by::text,
created_at
`, id)
return scanAttachment(row)
}
type attachmentScanner interface {
Scan(dest ...any) error
}