This commit is contained in:
Wolfgang Huß 2022-09-05 09:13:47 +02:00
parent e713f65522
commit 92e6cc3f1b
3 changed files with 0 additions and 13 deletions

View File

@ -55,12 +55,9 @@ const isMySocialMedia = rule({
const isAllowedToChangeGroupSettings = rule({
cache: 'no_cache',
})(async (_parent, args, { user, driver }) => {
// Wolle: console.log('isAllowedToChangeGroupSettings !!!')
if (!(user && user.id)) return false
const ownerId = user.id
const { id: groupId } = args
// Wolle: console.log('ownerId: ', ownerId)
// Wolle: console.log('groupId: ', groupId)
const session = driver.session()
const readTxPromise = session.readTransaction(async (transaction) => {
const transactionResponse = await transaction.run(
@ -77,8 +74,6 @@ const isAllowedToChangeGroupSettings = rule({
})
try {
const { owner, group } = await readTxPromise
// Wolle: console.log('owner: ', owner)
// Wolle: console.log('group: ', group)
return !!group && !!owner && ['owner'].includes(owner.myRoleInGroup)
} catch (error) {
throw new Error(error)

View File

@ -134,11 +134,8 @@ export default {
}
},
UpdateGroup: async (_parent, params, context, _resolveInfo) => {
// Wolle: console.log('UpdateGroup !!!')
const { categoryIds } = params
const { id: groupId, avatar: avatarInput } = params
// Wolle: console.log('categoryIds: ', categoryIds)
// Wolle: console.log('groupId: ', groupId)
delete params.categoryIds
if (CONFIG.CATEGORIES_ACTIVE && categoryIds) {
if (categoryIds.length < CATEGORIES_MIN) {
@ -184,7 +181,6 @@ export default {
OPTIONAL MATCH (:User {id: $userId})-[membership:MEMBER_OF]->(group)
RETURN group {.*, myRole: membership.role}
`
// Wolle: console.log('updateGroupCypher: ', updateGroupCypher)
const transactionResponse = await transaction.run(updateGroupCypher, {
groupId,
userId: context.user.id,

View File

@ -17,7 +17,6 @@ const neode = getNeode()
let authenticatedUser
let user
// Wolle: let groupAvartar
const categoryIds = ['cat9', 'cat4', 'cat15']
const descriptionAdditional100 =
@ -74,9 +73,6 @@ const seedBasicsAndClearAuthentication = async () => {
icon: 'paw',
}),
])
// Wolle: groupAvartar = await Factory.build('image', {
// url: 'https://s3.amazonaws.com/uifaces/faces/twitter/jimmuirhead/128.jpg',
// })
authenticatedUser = null
}