diff --git a/backend/src/schema/resolvers/groups.js b/backend/src/schema/resolvers/groups.js index a0787a9cb..887d84ef8 100644 --- a/backend/src/schema/resolvers/groups.js +++ b/backend/src/schema/resolvers/groups.js @@ -9,7 +9,7 @@ import Resolver, { convertObjectToCypherMapLiteral, } from './helpers/Resolver' import { mergeImage } from './images/images' -import createOrUpdateLocations from './users/location' +import { createOrUpdateLocations } from './users/location' export default { Query: { @@ -137,7 +137,7 @@ export default { }) try { const group = await writeTxResultPromise - await createOrUpdateLocations(params.id, 'Group', params.locationName, session) + await createOrUpdateLocations('Group', params.id, params.locationName, session) return group } catch (error) { if (error.code === 'Neo.ClientError.Schema.ConstraintValidationFailed') @@ -210,7 +210,7 @@ export default { }) try { const group = await writeTxResultPromise - await createOrUpdateLocations(params.id, 'Group', params.locationName, session) + await createOrUpdateLocations('Group', params.id, params.locationName, session) return group } catch (error) { if (error.code === 'Neo.ClientError.Schema.ConstraintValidationFailed') diff --git a/backend/src/schema/resolvers/users.js b/backend/src/schema/resolvers/users.js index bbb407229..52889a1c3 100644 --- a/backend/src/schema/resolvers/users.js +++ b/backend/src/schema/resolvers/users.js @@ -4,7 +4,7 @@ import { UserInputError, ForbiddenError } from 'apollo-server' import { mergeImage, deleteImage } from './images/images' import Resolver from './helpers/Resolver' import log from './helpers/databaseLogger' -import createOrUpdateLocations from './users/location' +import { createOrUpdateLocations } from './users/location' const neode = getNeode() @@ -169,7 +169,7 @@ export default { }) try { const user = await writeTxResultPromise - await createOrUpdateLocations(params.id, 'User', params.locationName, session) + await createOrUpdateLocations('User', params.id, params.locationName, session) return user } catch (error) { throw new UserInputError(error.message) diff --git a/backend/src/schema/resolvers/users/location.js b/backend/src/schema/resolvers/users/location.js index b6ae798f4..cd042b964 100644 --- a/backend/src/schema/resolvers/users/location.js +++ b/backend/src/schema/resolvers/users/location.js @@ -62,7 +62,7 @@ const createLocation = async (session, mapboxData) => { }) } -const createOrUpdateLocations = async (nodeId, nodeLabel, locationName, session) => { +export const createOrUpdateLocations = async (nodeLabel, nodeId, locationName, session) => { if (isEmpty(locationName)) { return } @@ -148,5 +148,3 @@ export const queryLocations = async ({ place, lang }) => { } return res.features } - -export default createOrUpdateLocations