mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
type ExpressContext
This commit is contained in:
parent
71d1701102
commit
f752d8d045
@ -1,9 +1,8 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
||||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
||||||
import { Role } from '@/auth/Role'
|
import { Role } from '@/auth/Role'
|
||||||
import { User as dbUser } from '@entity/User'
|
import { User as dbUser } from '@entity/User'
|
||||||
import { Transaction as dbTransaction } from '@entity/Transaction'
|
import { Transaction as dbTransaction } from '@entity/Transaction'
|
||||||
import Decimal from 'decimal.js-light'
|
import Decimal from 'decimal.js-light'
|
||||||
|
import { ExpressContext } from 'apollo-server-express'
|
||||||
|
|
||||||
export interface Context {
|
export interface Context {
|
||||||
token: string | null
|
token: string | null
|
||||||
@ -17,7 +16,7 @@ export interface Context {
|
|||||||
sumHoldAvailableAmount?: Decimal
|
sumHoldAvailableAmount?: Decimal
|
||||||
}
|
}
|
||||||
|
|
||||||
const context = (args: any): Context => {
|
const context = (args: ExpressContext): Context => {
|
||||||
const authorization = args.req.headers.authorization
|
const authorization = args.req.headers.authorization
|
||||||
let token: string | null = null
|
let token: string | null = null
|
||||||
if (authorization) {
|
if (authorization) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user