residual fixes

This commit is contained in:
Giancarmine Salucci
2026-03-24 18:17:42 +01:00
parent c20df6bc97
commit c1e1a9d05e
7 changed files with 17 additions and 5 deletions

View File

@@ -28,8 +28,8 @@ export const GET: RequestHandler = ({ url }) => {
const libraries = service.list({ state: state ?? undefined, limit, offset });
const total = service.count(state ?? undefined);
// Augment each library with its versions array
const enriched = libraries.map((repo) => ({
// Augment each library with its versions array; strip sensitive fields.
const enriched = libraries.map(({ githubToken: _token, ...repo }) => ({
...repo,
versions: service.getVersions(repo.id)
}));
@@ -63,8 +63,9 @@ export const POST: RequestHandler = async ({ request }) => {
jobResponse = { id: job.id, status: job.status };
}
const { githubToken: _token, ...safeRepo } = repo;
return json(
{ library: repo, ...(jobResponse ? { job: jobResponse } : {}) },
{ library: safeRepo, ...(jobResponse ? { job: jobResponse } : {}) },
{ status: 201 }
);
} catch (err) {