mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor: Lint for no unneeded backticks (#5057) (no-changelog)
* ✨ Create rule `no-unneeded-backticks` * 👕 Enable rule * ⚡ Run rule on `cli` * ⚡ Run rule on `core` * ⚡ Run rule on `workflow` * ⚡ Rule rule on `design-system` * ⚡ Run rule on `node-dev` * ⚡ Run rule on `editor-ui` * ⚡ Run rule on `nodes-base`
This commit is contained in:
@@ -125,7 +125,7 @@ workflowsController.get(
|
||||
* GET /workflows/new
|
||||
*/
|
||||
workflowsController.get(
|
||||
`/new`,
|
||||
'/new',
|
||||
ResponseHelper.send(async (req: WorkflowRequest.NewName) => {
|
||||
const requestedName =
|
||||
req.query.name && req.query.name !== ''
|
||||
@@ -148,14 +148,14 @@ workflowsController.get(
|
||||
* GET /workflows/from-url
|
||||
*/
|
||||
workflowsController.get(
|
||||
`/from-url`,
|
||||
'/from-url',
|
||||
ResponseHelper.send(async (req: express.Request): Promise<IWorkflowResponse> => {
|
||||
if (req.query.url === undefined) {
|
||||
throw new ResponseHelper.BadRequestError(`The parameter "url" is missing!`);
|
||||
throw new ResponseHelper.BadRequestError('The parameter "url" is missing!');
|
||||
}
|
||||
if (!/^http[s]?:\/\/.*\.json$/i.exec(req.query.url as string)) {
|
||||
throw new ResponseHelper.BadRequestError(
|
||||
`The parameter "url" is not valid! It does not seem to be a URL pointing to a n8n workflow JSON file.`,
|
||||
'The parameter "url" is not valid! It does not seem to be a URL pointing to a n8n workflow JSON file.',
|
||||
);
|
||||
}
|
||||
let workflowData: IWorkflowResponse | undefined;
|
||||
@@ -163,7 +163,7 @@ workflowsController.get(
|
||||
const { data } = await axios.get<IWorkflowResponse>(req.query.url as string);
|
||||
workflowData = data;
|
||||
} catch (error) {
|
||||
throw new ResponseHelper.BadRequestError(`The URL does not point to valid JSON file!`);
|
||||
throw new ResponseHelper.BadRequestError('The URL does not point to valid JSON file!');
|
||||
}
|
||||
|
||||
// Do a very basic check if it is really a n8n-workflow-json
|
||||
@@ -176,7 +176,7 @@ workflowsController.get(
|
||||
Array.isArray(workflowData.connections)
|
||||
) {
|
||||
throw new ResponseHelper.BadRequestError(
|
||||
`The data in the file does not seem to be a n8n workflow JSON file!`,
|
||||
'The data in the file does not seem to be a n8n workflow JSON file!',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ workflowsController.get(
|
||||
* PATCH /workflows/:id
|
||||
*/
|
||||
workflowsController.patch(
|
||||
`/:id`,
|
||||
'/:id',
|
||||
ResponseHelper.send(async (req: WorkflowRequest.Update) => {
|
||||
const { id: workflowId } = req.params;
|
||||
|
||||
@@ -253,7 +253,7 @@ workflowsController.patch(
|
||||
* DELETE /workflows/:id
|
||||
*/
|
||||
workflowsController.delete(
|
||||
`/:id`,
|
||||
'/:id',
|
||||
ResponseHelper.send(async (req: WorkflowRequest.Delete) => {
|
||||
const { id: workflowId } = req.params;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user