in src/api/websites/db.ts [41:51]
export async function retrieveWebsiteByAuditId(
conn: DbConnectionType,
auditId: string,
): Promise<Website> {
const res = await retrieveWebsiteList(conn, {
where: SQL`WHERE url IN (SELECT url FROM lighthouse_audits w WHERE w.id = ${auditId})`,
});
if (res.length === 0)
throw new NotFoundError(`website found for audit id "${auditId}"`);
return res[0];
}