mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
rename getPendingCreations
This commit is contained in:
parent
244cf20542
commit
d95b1893cd
@ -1,8 +1,8 @@
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export const getPendingCreations = gql`
|
||||
export const listUnconfirmedContributions = gql`
|
||||
query {
|
||||
getPendingCreations {
|
||||
listUnconfirmedContributions {
|
||||
id
|
||||
firstName
|
||||
lastName
|
||||
@ -9,7 +9,7 @@ const localVue = global.localVue
|
||||
const storeCommitMock = jest.fn()
|
||||
const apolloQueryMock = jest.fn().mockResolvedValue({
|
||||
data: {
|
||||
getPendingCreations: [
|
||||
listUnconfirmedContributions: [
|
||||
{
|
||||
id: 1,
|
||||
firstName: 'Bibi',
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<script>
|
||||
import Overlay from '../components/Overlay.vue'
|
||||
import OpenCreationsTable from '../components/Tables/OpenCreationsTable.vue'
|
||||
import { getPendingCreations } from '../graphql/getPendingCreations'
|
||||
import { listUnconfirmedContributions } from '../graphql/listUnconfirmedContributions'
|
||||
import { deletePendingCreation } from '../graphql/deletePendingCreation'
|
||||
import { confirmPendingCreation } from '../graphql/confirmPendingCreation'
|
||||
|
||||
@ -70,13 +70,13 @@ export default {
|
||||
getPendingCreations() {
|
||||
this.$apollo
|
||||
.query({
|
||||
query: getPendingCreations,
|
||||
query: listUnconfirmedContributions,
|
||||
fetchPolicy: 'network-only',
|
||||
})
|
||||
.then((result) => {
|
||||
this.$store.commit('resetOpenCreations')
|
||||
this.pendingCreations = result.data.getPendingCreations
|
||||
this.$store.commit('setOpenCreations', result.data.getPendingCreations.length)
|
||||
this.pendingCreations = result.data.listUnconfirmedContributions
|
||||
this.$store.commit('setOpenCreations', result.data.listUnconfirmedContributions.length)
|
||||
})
|
||||
.catch((error) => {
|
||||
this.toastError(error.message)
|
||||
|
||||
@ -5,7 +5,7 @@ const localVue = global.localVue
|
||||
|
||||
const apolloQueryMock = jest.fn().mockResolvedValue({
|
||||
data: {
|
||||
getPendingCreations: [
|
||||
listUnconfirmedContributions: [
|
||||
{
|
||||
pending: true,
|
||||
},
|
||||
@ -46,7 +46,7 @@ describe('Overview', () => {
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
|
||||
it('calls getPendingCreations', () => {
|
||||
it('calls listUnconfirmedContributions', () => {
|
||||
expect(apolloQueryMock).toBeCalled()
|
||||
})
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getPendingCreations } from '../graphql/getPendingCreations'
|
||||
import { listUnconfirmedContributions } from '../graphql/listUnconfirmedContributions'
|
||||
|
||||
export default {
|
||||
name: 'overview',
|
||||
@ -39,11 +39,11 @@ export default {
|
||||
async getPendingCreations() {
|
||||
this.$apollo
|
||||
.query({
|
||||
query: getPendingCreations,
|
||||
query: listUnconfirmedContributions,
|
||||
fetchPolicy: 'network-only',
|
||||
})
|
||||
.then((result) => {
|
||||
this.$store.commit('setOpenCreations', result.data.getPendingCreations.length)
|
||||
this.$store.commit('setOpenCreations', result.data.listUnconfirmedContributions.length)
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
@ -30,7 +30,7 @@ export enum RIGHTS {
|
||||
ADMIN_CREATE_CONTRIBUTION = 'ADMIN_CREATE_CONTRIBUTION',
|
||||
ADMIN_CREATE_CONTRIBUTIONS = 'ADMIN_CREATE_CONTRIBUTIONS',
|
||||
ADMIN_UPDATE_CONTRIBUTION = 'ADMIN_UPDATE_CONTRIBUTION',
|
||||
SEARCH_PENDING_CREATION = 'SEARCH_PENDING_CREATION',
|
||||
LIST_UNCONFIRMED_CONTRIBUTIONS = 'LIST_UNCONFIRMED_CONTRIBUTIONS',
|
||||
DELETE_PENDING_CREATION = 'DELETE_PENDING_CREATION',
|
||||
CONFIRM_PENDING_CREATION = 'CONFIRM_PENDING_CREATION',
|
||||
SEND_ACTIVATION_EMAIL = 'SEND_ACTIVATION_EMAIL',
|
||||
|
||||
@ -25,7 +25,7 @@ import {
|
||||
updateContributionLink,
|
||||
} from '@/seeds/graphql/mutations'
|
||||
import {
|
||||
getPendingCreations,
|
||||
listUnconfirmedContributions,
|
||||
login,
|
||||
searchUsers,
|
||||
listTransactionLinksAdmin,
|
||||
@ -548,11 +548,11 @@ describe('AdminResolver', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('getPendingCreations', () => {
|
||||
describe('listUnconfirmedContributions', () => {
|
||||
it('returns an error', async () => {
|
||||
await expect(
|
||||
query({
|
||||
query: getPendingCreations,
|
||||
query: listUnconfirmedContributions,
|
||||
}),
|
||||
).resolves.toEqual(
|
||||
expect.objectContaining({
|
||||
@ -658,11 +658,11 @@ describe('AdminResolver', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('getPendingCreations', () => {
|
||||
describe('listUnconfirmedContributions', () => {
|
||||
it('returns an error', async () => {
|
||||
await expect(
|
||||
query({
|
||||
query: getPendingCreations,
|
||||
query: listUnconfirmedContributions,
|
||||
}),
|
||||
).resolves.toEqual(
|
||||
expect.objectContaining({
|
||||
@ -1116,16 +1116,16 @@ describe('AdminResolver', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('getPendingCreations', () => {
|
||||
describe('listUnconfirmedContributions', () => {
|
||||
it('returns four pending creations', async () => {
|
||||
await expect(
|
||||
query({
|
||||
query: getPendingCreations,
|
||||
query: listUnconfirmedContributions,
|
||||
}),
|
||||
).resolves.toEqual(
|
||||
expect.objectContaining({
|
||||
data: {
|
||||
getPendingCreations: expect.arrayContaining([
|
||||
listUnconfirmedContributions: expect.arrayContaining([
|
||||
{
|
||||
id: expect.any(Number),
|
||||
firstName: 'Peter',
|
||||
|
||||
@ -283,9 +283,9 @@ export class AdminResolver {
|
||||
return result
|
||||
}
|
||||
|
||||
@Authorized([RIGHTS.SEARCH_PENDING_CREATION])
|
||||
@Authorized([RIGHTS.LIST_UNCONFIRMED_CONTRIBUTIONS])
|
||||
@Query(() => [UnconfirmedContribution])
|
||||
async getPendingCreations(): Promise<UnconfirmedContribution[]> {
|
||||
async listUnconfirmedContributions(): Promise<UnconfirmedContribution[]> {
|
||||
const contributions = await Contribution.find({ where: { confirmedAt: IsNull() } })
|
||||
if (contributions.length === 0) {
|
||||
return []
|
||||
|
||||
@ -173,9 +173,9 @@ export const queryTransactionLink = gql`
|
||||
|
||||
// from admin interface
|
||||
|
||||
export const getPendingCreations = gql`
|
||||
export const listUnconfirmedContributions = gql`
|
||||
query {
|
||||
getPendingCreations {
|
||||
listUnconfirmedContributions {
|
||||
id
|
||||
firstName
|
||||
lastName
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user