This commit is contained in:
Ulf Gebhardt 2023-03-10 16:45:00 +01:00
parent c54e6fb8ae
commit 31130020b3
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
6 changed files with 13 additions and 27 deletions

View File

@ -65,7 +65,7 @@ module.exports = {
'import/no-namespace': 'error',
'import/no-unassigned-import': 'error',
'import/order': 'error',
'import/prefer-default-export': 'off', //TODO
'import/prefer-default-export': 'off', // TODO
},
overrides: [
// only for ts files

View File

@ -1,7 +1,7 @@
import { GraphQLScalarType, Kind } from 'graphql'
import { Decimal } from 'decimal.js-light'
export default new GraphQLScalarType({
const DecimalType = new GraphQLScalarType({
name: 'Decimal',
description: 'The `Decimal` scalar type to represent currency values',
@ -21,3 +21,5 @@ export default new GraphQLScalarType({
return new Decimal(ast.value)
},
})
export default DecimalType

View File

@ -1,35 +1,20 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable @typescript-eslint/unbound-method */
import 'reflect-metadata'
import { ApolloServer } from 'apollo-server-express'
import express, { Express, json, urlencoded } from 'express'
// database
import connection from '@/typeorm/connection'
import { checkDBVersion } from '@/typeorm/DBVersion'
// server
import { Connection } from '@dbTools/typeorm'
import { Logger } from 'log4js'
import cors from './cors'
import serverContext from './context'
import plugins from './plugins'
// config
import CONFIG from '@/config'
// graphql
import schema from '@/graphql/schema'
// webhooks
import { elopageWebhook } from '@/webhook/elopage'
import { Connection } from '@dbTools/typeorm'
import { apolloLogger } from './logger'
import { Logger } from 'log4js'
// i18n
import { i18n } from './localization'
import connection from '@/typeorm/connection'
import { checkDBVersion } from '@/typeorm/DBVersion'
import CONFIG from '@/config'
import schema from '@/graphql/schema'
import { elopageWebhook } from '@/webhook/elopage'
// TODO implement
// import queryComplexity, { simpleEstimator, fieldConfigEstimator } from "graphql-query-complexity";

View File

@ -1,5 +1,4 @@
import { Decimal } from 'decimal.js-light'
import 'reflect-metadata' // This might be wise to load in a test setup file
import { decayFormula, calculateDecay } from './decay'
describe('utils/decay', () => {

View File

@ -1,6 +1,6 @@
import { User } from '@entity/User'
import connection from '@/typeorm/connection'
import { getKlickTippUser } from '@/apis/KlicktippController'
import { User } from '@entity/User'
import LogError from '@/server/LogError'
export async function retrieveNotRegisteredEmails(): Promise<string[]> {

View File

@ -32,8 +32,8 @@
*/
import { LoginElopageBuys } from '@entity/LoginElopageBuys'
import { UserResolver } from '@/graphql/resolver/UserResolver'
import { UserContact as dbUserContact } from '@entity/UserContact'
import { UserResolver } from '@/graphql/resolver/UserResolver'
export const elopageWebhook = async (req: any, res: any): Promise<void> => {
// eslint-disable-next-line no-console