fix(coderd): fix audit log resource link for tasks (#20545)

Existing task audit log links were incorrect. As audit log links are
generated on-the-fly, this does not require backfill.
This commit is contained in:
Cian Johnston
2025-10-29 15:31:41 +00:00
committed by GitHub
parent 7e8fcb4b0f
commit 566146af72
+2 -2
View File
@@ -509,11 +509,11 @@ func (api *API) auditLogResourceLink(ctx context.Context, alog database.GetAudit
if err != nil {
return ""
}
workspace, err := api.Database.GetWorkspaceByID(ctx, task.WorkspaceID.UUID)
user, err := api.Database.GetUserByID(ctx, task.OwnerID)
if err != nil {
return ""
}
return fmt.Sprintf("/tasks/%s/%s", workspace.OwnerName, task.Name)
return fmt.Sprintf("/tasks/%s/%s", user.Username, task.ID)
default:
return ""