Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcrt committed Nov 25, 2024
1 parent d179ff2 commit f6d7c78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 52 deletions.
52 changes: 0 additions & 52 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions packages/backend/src/api/v1/runs/ingest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,22 @@ async function registerRunEvent(
* The projectId passed to this function is the public key, so it may not necessarily be the correct one for the current event.
*/
const apiKey = event.appId;
// console.log(apiKey, projectId);
if (typeof apiKey === "string") {
const [project] = await sql`
select project_id from api_key where api_key = ${apiKey}
`;

if (project) {
projectId = project.projectId;
} else {
// TODO: this is a temp fix because some projects are not associated with an API key
const [project] = await sql`
select id from project where id = ${apiKey}
`;
if (project) {
projectId = project.id;
}
}
}

Expand Down

0 comments on commit f6d7c78

Please sign in to comment.