Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Return entire history in queryLogs function
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent e84b02c commit fe58ffd
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions functions/gcloud.ts
Expand Up @@ -261,18 +261,17 @@ export async function queryLogs(user: number, context: RequestContext) {
throw new Error("Failed to query logs");
}

const entityResult =
return (
(
(await queryRequest.json()) as {
batch: { entityResults: { [k: string]: { [k: string]: any } }[] };
batch: {
entityResults: {
cursor: string;
entity: { [k: string]: any };
version: string;
}[];
};
}
).batch?.entityResults ?? [];

if (!entityResult.length) return {};

const entity = entityResult[0].entity.properties;
delete entity.executor;
delete entity.target;

return entity;
).batch?.entityResults ?? []
);
}

0 comments on commit fe58ffd

Please sign in to comment.