Change to using arrow functions (#1603)
* Change to using arrow functions Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Matheus <matheus_benini@hotmail.com> * Add lint rule --------- Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Matheus <matheus_benini@hotmail.com> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { FilterOperand } from '../types/FilterOperand';
|
||||
|
||||
export function getOperandLabel(operand: FilterOperand | null | undefined) {
|
||||
export const getOperandLabel = (operand: FilterOperand | null | undefined) => {
|
||||
switch (operand) {
|
||||
case FilterOperand.Contains:
|
||||
return 'Contains';
|
||||
@@ -17,10 +17,11 @@ export function getOperandLabel(operand: FilterOperand | null | undefined) {
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
export function getOperandLabelShort(
|
||||
};
|
||||
|
||||
export const getOperandLabelShort = (
|
||||
operand: FilterOperand | null | undefined,
|
||||
) {
|
||||
) => {
|
||||
switch (operand) {
|
||||
case FilterOperand.Is:
|
||||
case FilterOperand.Contains:
|
||||
@@ -35,4 +36,4 @@ export function getOperandLabelShort(
|
||||
default:
|
||||
return ': ';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { FilterOperand } from '../types/FilterOperand';
|
||||
import { FilterType } from '../types/FilterType';
|
||||
|
||||
export function getOperandsForFilterType(
|
||||
export const getOperandsForFilterType = (
|
||||
filterType: FilterType | null | undefined,
|
||||
): FilterOperand[] {
|
||||
): FilterOperand[] => {
|
||||
switch (filterType) {
|
||||
case 'text':
|
||||
return [FilterOperand.Contains, FilterOperand.DoesNotContain];
|
||||
@@ -15,4 +15,4 @@ export function getOperandsForFilterType(
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@ import { QueryMode } from '~/generated/graphql';
|
||||
import { Filter } from '../types/Filter';
|
||||
import { FilterOperand } from '../types/FilterOperand';
|
||||
|
||||
export function turnFilterIntoWhereClause(filter: Filter) {
|
||||
export const turnFilterIntoWhereClause = (filter: Filter) => {
|
||||
switch (filter.type) {
|
||||
case 'text':
|
||||
switch (filter.operand) {
|
||||
@@ -88,4 +88,4 @@ export function turnFilterIntoWhereClause(filter: Filter) {
|
||||
default:
|
||||
throw new Error('Unknown filter type');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user