refactor: snapshots flat response

This commit is contained in:
Nicolas Meienberger
2025-11-03 21:54:31 +01:00
parent acc5f44565
commit f2643436b0
5 changed files with 19 additions and 17 deletions

View File

@@ -69,9 +69,7 @@ export const repositoriesController = new Hono()
};
});
const response = { snapshots };
return c.json<ListSnapshotsDto>(response, 200);
return c.json<ListSnapshotsDto>(snapshots, 200);
})
.get(
"/:name/snapshots/:snapshotId/files",

View File

@@ -139,9 +139,7 @@ export const snapshotSchema = type({
duration: "number",
});
const listSnapshotsResponse = type({
snapshots: snapshotSchema.array(),
});
const listSnapshotsResponse = snapshotSchema.array();
export type ListSnapshotsDto = typeof listSnapshotsResponse.infer;