fix(admin): return contact_email from the revoke query (#260)
The revoke route's RETURNING clause omitted contact_email while its result was typed as UploadLinkRow, which declares the field as present. No user-visible effect since the response was never checked for it, but the type asserted something the query did not actually return. Added the column so the two agree. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -182,7 +182,7 @@ router.post('/:id/revoke', asyncRoute(async (req: Request, res: Response) => {
|
|||||||
const { rows } = await pool.query<UploadLinkRow>(
|
const { rows } = await pool.query<UploadLinkRow>(
|
||||||
`UPDATE upload_links SET revoked_at = COALESCE(revoked_at, now())
|
`UPDATE upload_links SET revoked_at = COALESCE(revoked_at, now())
|
||||||
WHERE id = $1
|
WHERE id = $1
|
||||||
RETURNING id, label, revoked_at, submission_count, max_submissions, last_used_at, created_at`,
|
RETURNING id, label, contact_email, revoked_at, submission_count, max_submissions, last_used_at, created_at`,
|
||||||
[req.params.id]
|
[req.params.id]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user