refactor(core): Remove linting exceptions in nodes-base (no-changelog) (#4944)

This commit is contained in:
Michael Kret
2023-01-13 19:11:56 +02:00
committed by GitHub
parent d7732ea150
commit 6608e69457
254 changed files with 2687 additions and 2675 deletions

View File

@@ -8,6 +8,10 @@ import { flow } from 'lodash';
import type { Zammad } from './types';
export function tolerateTrailingSlash(url: string) {
return url.endsWith('/') ? url.substr(0, url.length - 1) : url;
}
export async function zammadApiRequest(
this: IExecuteFunctions | ILoadOptionsFunctions,
method: string,
@@ -105,10 +109,6 @@ export async function zammadApiRequestAllItems(
return returnData;
}
export function tolerateTrailingSlash(url: string) {
return url.endsWith('/') ? url.substr(0, url.length - 1) : url;
}
export function throwOnEmptyUpdate(this: IExecuteFunctions, resource: string) {
throw new NodeOperationError(
this.getNode(),
@@ -120,12 +120,12 @@ export function throwOnEmptyUpdate(this: IExecuteFunctions, resource: string) {
// loadOptions utils
// ----------------------------------
export const prettifyDisplayName = (fieldName: string) => fieldName.replace('name', ' Name');
export const fieldToLoadOption = (i: Zammad.Field) => {
return { name: i.display ? prettifyDisplayName(i.display) : i.name, value: i.name };
};
export const prettifyDisplayName = (fieldName: string) => fieldName.replace('name', ' Name');
export const isCustomer = (user: Zammad.User) =>
user.role_ids.includes(3) && !user.email.endsWith('@zammad.org');