mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Change create method from query to mutation.
This commit is contained in:
parent
e47a95cd4b
commit
daeb0ed32c
@ -270,8 +270,8 @@ export default {
|
||||
})
|
||||
} else {
|
||||
this.$apollo
|
||||
.query({
|
||||
query: createPendingCreation,
|
||||
.mutate({
|
||||
mutation: createPendingCreation,
|
||||
variables: this.submitObj,
|
||||
})
|
||||
.then((result) => {
|
||||
|
||||
@ -1,11 +1,17 @@
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export const createPendingCreation = gql`
|
||||
query ($email: String!, $amount: Int!, $note: String!, $creationDate: String!, $moderator: Int!) {
|
||||
mutation (
|
||||
$email: String!
|
||||
$amount: Int!
|
||||
$memo: String!
|
||||
$creationDate: String!
|
||||
$moderator: Int!
|
||||
) {
|
||||
createPendingCreation(
|
||||
email: $email
|
||||
amount: $amount
|
||||
note: $note
|
||||
memo: $memo
|
||||
creationDate: $creationDate
|
||||
moderator: $moderator
|
||||
)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Resolver, Query, Arg, Args, Authorized } from 'type-graphql'
|
||||
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'
|
||||
@ -29,7 +29,7 @@ export class AdminResolver {
|
||||
return users
|
||||
}
|
||||
|
||||
@Query(() => [Number])
|
||||
@Mutation(() => [Number])
|
||||
async createPendingCreation(
|
||||
@Args() { email, amount, memo, creationDate, moderator }: CreatePendingCreationArgs,
|
||||
): Promise<number[]> {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user