Standard Format Code Changes

This commit is contained in:
Matias committed 2019-02-14 12:36:43 -03:00
1 parent 4ce8cde5b0
commit 37028e34ad
33 files changed
+175 -232

No files matched your search

@@ -6,14 +6,12 @@ import { BotTypesEnum } from '../../enums/BotTypes'
import teamQuery from '../../graphQLCalls/teamQuery'
import authorizeClone from '../../graphQLCalls/authorizeClone'
import cloneDetails from '../cloneDetails'
import {
AuthentificationError,
WrongArgumentsError,
OperationsError,
AutorizationError
} from '../../errors'
import logger from '../../config/logger'
import createKubernetesClone from '../../kubernetes/createClone'
import { isDefined } from '../../config/utils'
@@ -1,14 +1,5 @@
import {
GraphQLNonNull,
GraphQLID,
GraphQLString
} from 'graphql'
import {
AuthentificationError,
OperationsError
} from '../../errors'
import { GraphQLNonNull, GraphQLID, GraphQLString } from 'graphql'
import { AuthentificationError, OperationsError } from '../../errors'
import { Clone } from '../../models'
import logger from '../../config/logger'
import removeKuberneteClone from '../../kubernetes/removeClone'
@@ -33,7 +24,7 @@ const resolve = async (parent, { id }, context) => {
active: true
})
if(!isDefined(clone)){
if (!isDefined(clone)) {
throw new OperationsError('You are not authorized to remove this clone.')
}
@@ -54,12 +45,12 @@ const resolve = async (parent, { id }, context) => {
const update = { active: false }
Clone.findOneAndUpdate(query, update, options, (err, doc) => {
if (err){
if (err) {
logger.error('removeClone -> Error removing clone from the DB. %s', err.stack)
throw new OperationsError(err)
}else{
} else {
logger.debug('removeClone -> Clone Removed from the DB.')
return('Clone Removed.')
return ('Clone Removed.')
}
})
}
@@ -5,9 +5,7 @@ import {
GraphQLInt,
GraphQLFloat
} from 'graphql'
import {
OperationsError
} from '../../errors'
import { OperationsError } from '../../errors'
import { Clone } from '../../models'
import logger from '../../config/logger'
import teamQuery from '../../graphQLCalls/teamQuery'
+1 -4
View File
@@ -1,7 +1,4 @@
import {
GraphQLObjectType
} from 'graphql'
import { GraphQLObjectType } from 'graphql'
import AddCloneMutation from './AddCloneMutation'
import RemoveCloneMutation from './RemoveCloneMutation'
import UpdateExecutionSummary from './UpdateExecutionSummary'