-
- Die anzahl der offene Schöpfungen stimmen nicht! Diese wird bei absenden im $store
- hochgezählt. Die Liste die hier angezeigt wird ist SIMULIERT!
-
diff --git a/admin/src/pages/Overview.vue b/admin/src/pages/Overview.vue
index 056bb14a6..1c58751bc 100644
--- a/admin/src/pages/Overview.vue
+++ b/admin/src/pages/Overview.vue
@@ -76,7 +76,24 @@
diff --git a/admin/src/store/store.js b/admin/src/store/store.js
index d67537499..9319eafd8 100644
--- a/admin/src/store/store.js
+++ b/admin/src/store/store.js
@@ -18,6 +18,9 @@ export const mutations = {
token: (state, token) => {
state.token = token
},
+ setOpenCreations: (state, openCreations) => {
+ state.openCreations = openCreations
+ },
moderator: (state, moderator) => {
state.moderator = moderator
},
diff --git a/admin/src/store/store.test.js b/admin/src/store/store.test.js
index 4482a46bf..7b8784cdd 100644
--- a/admin/src/store/store.test.js
+++ b/admin/src/store/store.test.js
@@ -1,11 +1,13 @@
import store, { mutations, actions } from './store'
+import CONFIG from '../config'
-const { token, openCreationsPlus, openCreationsMinus, resetOpenCreations } = mutations
+jest.mock('../config')
+
+const { token, openCreationsPlus, openCreationsMinus, resetOpenCreations, setOpenCreations } =
+ mutations
const { logout } = actions
-const CONFIG = {
- DEBUG_DISABLE_AUTH: true,
-}
+CONFIG.DEBUG_DISABLE_AUTH = true
describe('Vuex store', () => {
describe('mutations', () => {
@@ -40,6 +42,14 @@ describe('Vuex store', () => {
expect(state.openCreations).toEqual(0)
})
})
+
+ describe('setOpenCreations', () => {
+ it('sets the open creations to given value', () => {
+ const state = { openCreations: 24 }
+ setOpenCreations(state, 12)
+ expect(state.openCreations).toEqual(12)
+ })
+ })
})
describe('actions', () => {
diff --git a/backend/src/graphql/model/PendingCreation.ts b/backend/src/graphql/model/PendingCreation.ts
new file mode 100644
index 000000000..f1087ea0b
--- /dev/null
+++ b/backend/src/graphql/model/PendingCreation.ts
@@ -0,0 +1,34 @@
+import { ObjectType, Field, Int } from 'type-graphql'
+
+@ObjectType()
+export class PendingCreation {
+ @Field(() => String)
+ firstName: string
+
+ @Field(() => Int)
+ id?: number
+
+ @Field(() => String)
+ lastName: string
+
+ @Field(() => Number)
+ userId: number
+
+ @Field(() => String)
+ email: string
+
+ @Field(() => Date)
+ date: Date
+
+ @Field(() => String)
+ memo: string
+
+ @Field(() => Number)
+ amount: BigInt
+
+ @Field(() => Number)
+ moderator: number
+
+ @Field(() => [Number])
+ creation: number[]
+}
diff --git a/backend/src/graphql/resolver/AdminResolver.ts b/backend/src/graphql/resolver/AdminResolver.ts
index f3c9d1516..169b79250 100644
--- a/backend/src/graphql/resolver/AdminResolver.ts
+++ b/backend/src/graphql/resolver/AdminResolver.ts
@@ -1,7 +1,7 @@
import { Resolver, Query, Arg, Args, Authorized, Mutation } from 'type-graphql'
import { getCustomRepository, Raw } from 'typeorm'
import { UserAdmin } from '../model/UserAdmin'
-import { LoginUserRepository } from '../../typeorm/repository/LoginUser'
+import { PendingCreation } from '../model/PendingCreation'
import { RIGHTS } from '../../auth/RIGHTS'
import { TransactionCreationRepository } from '../../typeorm/repository/TransactionCreation'
import { PendingCreationRepository } from '../../typeorm/repository/PendingCreation'
@@ -14,19 +14,19 @@ export class AdminResolver {
@Authorized([RIGHTS.SEARCH_USERS])
@Query(() => [UserAdmin])
async searchUsers(@Arg('searchText') searchText: string): Promise