From fe58ffd3fd4f85009407f3b637c55b7b0d64fce3 Mon Sep 17 00:00:00 2001 From: regalijan Date: Thu, 19 Oct 2023 16:49:46 -0400 Subject: [PATCH] Return entire history in queryLogs function --- functions/gcloud.ts | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/functions/gcloud.ts b/functions/gcloud.ts index e5d4c5b..f1d6514 100644 --- a/functions/gcloud.ts +++ b/functions/gcloud.ts @@ -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 ?? [] + ); }