mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
fix lint
This commit is contained in:
parent
1b4550b658
commit
5f1bd0faae
@ -11,11 +11,11 @@ export class EditCommunityInput {
|
||||
@IsUUID('4')
|
||||
uuid: string
|
||||
|
||||
@Field(() => String, {nullable: true})
|
||||
@Field(() => String, { nullable: true })
|
||||
@IsString()
|
||||
gmsApiKey: string | null
|
||||
gmsApiKey?: string | null
|
||||
|
||||
@Field(() => Point, {nullable: true})
|
||||
@Field(() => Point, { nullable: true })
|
||||
@isValidPoint()
|
||||
location: Point | null
|
||||
location?: Point | null
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ export class Point implements geojsonPoint {
|
||||
this.coordinates = []
|
||||
this.type = 'Point'
|
||||
}
|
||||
|
||||
type: 'Point'
|
||||
coordinates: Position
|
||||
}
|
||||
|
||||
@ -89,8 +89,8 @@ export class CommunityResolver {
|
||||
throw new LogError('Error: Only the HomeCommunity could be modified!')
|
||||
}
|
||||
if (homeCom.gmsApiKey !== gmsApiKey || homeCom.location !== location) {
|
||||
homeCom.gmsApiKey = gmsApiKey
|
||||
homeCom.location = location
|
||||
homeCom.gmsApiKey = gmsApiKey ?? null
|
||||
homeCom.location = location ?? null
|
||||
await DbCommunity.save(homeCom)
|
||||
}
|
||||
return new Community(homeCom)
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
import { GraphQLScalarType, Kind } from 'graphql'
|
||||
|
||||
import { Point } from '@/graphql/model/Point'
|
||||
|
||||
export const PointScalar = new GraphQLScalarType({
|
||||
@ -10,14 +11,15 @@ export const PointScalar = new GraphQLScalarType({
|
||||
serialize(value: Point) {
|
||||
// Check type of value
|
||||
if (value.type !== 'Point') {
|
||||
throw new Error(`PointScalar can only serialize Geometry type 'Point' values`, )
|
||||
throw new Error(`PointScalar can only serialize Geometry type 'Point' values`)
|
||||
}
|
||||
return value
|
||||
},
|
||||
|
||||
parseValue(value): Point {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
if (value.type !== 'Point') {
|
||||
throw new Error(`PointScalar can only deserialize Geometry type 'Point' values`, )
|
||||
throw new Error(`PointScalar can only deserialize Geometry type 'Point' values`)
|
||||
}
|
||||
return value as Point
|
||||
},
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { registerDecorator, ValidationOptions, ValidationArguments } from 'class-validator'
|
||||
|
||||
import { Point } from '@/graphql/model/Point'
|
||||
|
||||
export function isValidPoint(validationOptions?: ValidationOptions) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user