Let admins edit event date and time
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,9 @@ UPDATE events SET title = ?, date = ?, time = ?, location = ? WHERE id = ?;
|
||||
-- name: UpdateEventLocation :exec
|
||||
UPDATE events SET location = ? WHERE id = ?;
|
||||
|
||||
-- name: UpdateEventDateTime :exec
|
||||
UPDATE events SET date = ?, time = ? WHERE id = ?;
|
||||
|
||||
-- name: DeleteEvent :exec
|
||||
DELETE FROM events WHERE id = ?;
|
||||
|
||||
|
||||
@@ -767,6 +767,21 @@ func (q *Queries) UpdateEvent(ctx context.Context, arg UpdateEventParams) error
|
||||
return err
|
||||
}
|
||||
|
||||
const updateEventDateTime = `-- name: UpdateEventDateTime :exec
|
||||
UPDATE events SET date = ?, time = ? WHERE id = ?
|
||||
`
|
||||
|
||||
type UpdateEventDateTimeParams struct {
|
||||
Date string
|
||||
Time string
|
||||
ID int64
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateEventDateTime(ctx context.Context, arg UpdateEventDateTimeParams) error {
|
||||
_, err := q.db.ExecContext(ctx, updateEventDateTime, arg.Date, arg.Time, arg.ID)
|
||||
return err
|
||||
}
|
||||
|
||||
const updateEventDescription = `-- name: UpdateEventDescription :exec
|
||||
UPDATE events SET description = ? WHERE id = ?
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user