mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Re-trigger tests
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user