residual fixes
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user