mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge moderator search from admin_pending_creation.
This commit is contained in:
commit
640109d8bf
@ -126,6 +126,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { verifyLogin } from '../graphql/verifyLogin'
|
||||
import { createPendingCreation } from '../graphql/createPendingCreation'
|
||||
export default {
|
||||
name: 'CreationFormular',
|
||||
@ -298,6 +299,19 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
searchModeratorData() {
|
||||
this.$apollo
|
||||
.query({ query: verifyLogin })
|
||||
.then((result) => {
|
||||
this.$store.commit('moderator', result.data.verifyLogin)
|
||||
})
|
||||
.catch(() => {
|
||||
this.$store.commit('moderator', { id: 0, name: 'Test Moderator' })
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.searchModeratorData()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
11
admin/src/graphql/verifyLogin.js
Normal file
11
admin/src/graphql/verifyLogin.js
Normal file
@ -0,0 +1,11 @@
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export const verifyLogin = gql`
|
||||
query {
|
||||
verifyLogin {
|
||||
firstName
|
||||
lastName
|
||||
id
|
||||
}
|
||||
}
|
||||
`
|
||||
@ -21,6 +21,9 @@ export const mutations = {
|
||||
setOpenCreations: (state, openCreations) => {
|
||||
state.openCreations = openCreations
|
||||
},
|
||||
moderator: (state, moderator) => {
|
||||
state.moderator = moderator
|
||||
},
|
||||
}
|
||||
|
||||
export const actions = {
|
||||
|
||||
@ -12,6 +12,7 @@ export class User {
|
||||
*/
|
||||
constructor(json?: any) {
|
||||
if (json) {
|
||||
this.id = json.id
|
||||
this.email = json.email
|
||||
this.firstName = json.first_name
|
||||
this.lastName = json.last_name
|
||||
@ -24,6 +25,9 @@ export class User {
|
||||
}
|
||||
}
|
||||
|
||||
@Field(() => Number)
|
||||
id: number
|
||||
|
||||
@Field(() => String)
|
||||
email: string
|
||||
|
||||
|
||||
@ -207,6 +207,7 @@ export class UserResolver {
|
||||
const loginUserRepository = getCustomRepository(LoginUserRepository)
|
||||
const loginUser = await loginUserRepository.findByEmail(userEntity.email)
|
||||
const user = new User()
|
||||
user.id = userEntity.id
|
||||
user.email = userEntity.email
|
||||
user.firstName = userEntity.firstName
|
||||
user.lastName = userEntity.lastName
|
||||
@ -276,6 +277,7 @@ export class UserResolver {
|
||||
}
|
||||
|
||||
const user = new User()
|
||||
user.id = userEntity.id
|
||||
user.email = email
|
||||
user.firstName = loginUser.firstName
|
||||
user.lastName = loginUser.lastName
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user