Changeset 0.17.1 (#76)
This commit is contained in:
@@ -162,7 +162,7 @@ func (h *AttachmentHandler) Upload(c *gin.Context) {
|
||||
|
||||
// Update storage_key in PG
|
||||
database.DB.ExecContext(c.Request.Context(),
|
||||
`UPDATE attachments SET storage_key = $1 WHERE id = $2`,
|
||||
database.Q(`UPDATE attachments SET storage_key = $1 WHERE id = $2`),
|
||||
att.StorageKey, att.ID)
|
||||
|
||||
// For images, mark extraction as not needed (complete immediately)
|
||||
@@ -421,7 +421,7 @@ func (h *AttachmentHandler) CleanupChannelStorage(channelID string) {
|
||||
func (h *AttachmentHandler) verifyChannelAccess(c *gin.Context, channelID, userID string) bool {
|
||||
var ownerID string
|
||||
err := database.DB.QueryRowContext(c.Request.Context(),
|
||||
`SELECT user_id FROM channels WHERE id = $1`, channelID).Scan(&ownerID)
|
||||
database.Q(`SELECT user_id FROM channels WHERE id = $1`), channelID).Scan(&ownerID)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusNotFound, gin.H{"error": "channel not found"})
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user