Merge branch 'adminDeletePendingCreationQuery' into adminConfirmPendingCreation

This commit is contained in:
elweyn 2021-12-03 17:17:41 +01:00
commit 2c2e56024d
5 changed files with 12 additions and 11 deletions

View File

@ -60,8 +60,11 @@ describe('CreationConfirm', () => {
})
describe('store', () => {
it('commits openCreationsPlus to store', () => {
expect(storeCommitMock).toBeCalledWith('openCreationsPlus', 2)
it('commits resetOpenCreations to store', () => {
expect(storeCommitMock).toBeCalledWith('resetOpenCreations')
})
it('commits setOpenCreations to store', () => {
expect(storeCommitMock).toBeCalledWith('setOpenCreations', 2)
})
})

View File

@ -64,15 +64,15 @@ export default {
this.$store.commit('openCreationsMinus', 1)
}
},
async getPendingCreations() {
getPendingCreations() {
this.$apollo
.query({
query: getPendingCreations,
})
.then((result) => {
this.confirmResult = result.data.getPendingCreations
this.$store.commit('resetOpenCreations')
this.$store.commit('openCreationsPlus', result.data.getPendingCreations.length)
this.confirmResult = result.data.getPendingCreations.reverse()
this.$store.commit('setOpenCreations', result.data.getPendingCreations.length)
})
.catch((error) => {
this.$toasted.error(error.message)

View File

@ -64,11 +64,7 @@ export default {
query: getPendingCreations,
})
.then((result) => {
this.$store.commit('resetOpenCreations')
this.$store.commit('openCreationsPlus', result.data.getPendingCreations.length)
})
.catch((error) => {
this.$toasted.error(error.message)
this.$store.commit('setOpenCreations', result.data.getPendingCreations.length)
})
},
},

View File

@ -135,7 +135,7 @@ export class AdminResolver {
return pendingCreationsPromise
}
@Query(() => Boolean)
@Mutation(() => Boolean)
async deletePendingCreation(@Arg('id') id: number): Promise<boolean> {
const pendingCreationRepository = getCustomRepository(PendingCreationRepository)
const entity = await pendingCreationRepository.findOne(id)

View File

@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/*
Elopage Webhook