mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-02 19:25:51 +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 fp from "fastify-plugin";
|
||||||
|
|
||||||
import { DefaultResponseErrorsSchema } from "../routes/sanitizedSchemas";
|
import { DefaultResponseErrorsSchema } from "../routes/sanitizedSchemas";
|
||||||
@@ -5,15 +6,12 @@ import { DefaultResponseErrorsSchema } from "../routes/sanitizedSchemas";
|
|||||||
export const addErrorsToResponseSchemas = fp(async (server) => {
|
export const addErrorsToResponseSchemas = fp(async (server) => {
|
||||||
server.addHook("onRoute", (routeOptions) => {
|
server.addHook("onRoute", (routeOptions) => {
|
||||||
if (routeOptions.schema && routeOptions.schema.response) {
|
if (routeOptions.schema && routeOptions.schema.response) {
|
||||||
// eslint-disable-next-line no-param-reassign
|
|
||||||
routeOptions.schema.response = {
|
routeOptions.schema.response = {
|
||||||
...DefaultResponseErrorsSchema,
|
...DefaultResponseErrorsSchema,
|
||||||
...routeOptions.schema.response
|
...routeOptions.schema.response
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
// eslint-disable-next-line no-param-reassign
|
|
||||||
routeOptions.schema = routeOptions.schema || {};
|
routeOptions.schema = routeOptions.schema || {};
|
||||||
// eslint-disable-next-line no-param-reassign
|
|
||||||
routeOptions.schema.response = { ...DefaultResponseErrorsSchema };
|
routeOptions.schema.response = { ...DefaultResponseErrorsSchema };
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user