diff --git a/backend/src/server/plugins/add-errors-to-response-schemas.ts b/backend/src/server/plugins/add-errors-to-response-schemas.ts index a9ea6f882..e37243eba 100644 --- a/backend/src/server/plugins/add-errors-to-response-schemas.ts +++ b/backend/src/server/plugins/add-errors-to-response-schemas.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-param-reassign */ import fp from "fastify-plugin"; import { DefaultResponseErrorsSchema } from "../routes/sanitizedSchemas"; @@ -5,15 +6,12 @@ import { DefaultResponseErrorsSchema } from "../routes/sanitizedSchemas"; export const addErrorsToResponseSchemas = fp(async (server) => { server.addHook("onRoute", (routeOptions) => { if (routeOptions.schema && routeOptions.schema.response) { - // eslint-disable-next-line no-param-reassign routeOptions.schema.response = { ...DefaultResponseErrorsSchema, ...routeOptions.schema.response }; } else { - // eslint-disable-next-line no-param-reassign routeOptions.schema = routeOptions.schema || {}; - // eslint-disable-next-line no-param-reassign routeOptions.schema.response = { ...DefaultResponseErrorsSchema }; } });