diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index edf78f0..40ecbf1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,3 +51,13 @@ This project and everyone participating in it is governed by the [Open Archiver - Follow the existing code style. - Use TypeScript's strict mode. - Avoid using `any` as a type. Define clear interfaces and types in the `packages/types` directory. + +### Formatting + +We use Prettier for code formatting. Before you commit new code, it is necessary to check code format by running this command from the root folder: + +`pnpm run lint` + +If there are any format issues, you can use the following command to fix them + +`pnpm run format` diff --git a/packages/backend/src/api/controllers/ingestion.controller.ts b/packages/backend/src/api/controllers/ingestion.controller.ts index 746f1c8..c9d3ed2 100644 --- a/packages/backend/src/api/controllers/ingestion.controller.ts +++ b/packages/backend/src/api/controllers/ingestion.controller.ts @@ -33,13 +33,10 @@ export class IngestionController { } catch (error: any) { logger.error({ err: error }, 'Create ingestion source error'); // Return a 400 Bad Request for connection errors - return res - .status(400) - .json({ - message: - error.message || - 'Failed to create ingestion source due to a connection error.', - }); + return res.status(400).json({ + message: + error.message || 'Failed to create ingestion source due to a connection error.', + }); } };