From 256c84d1323bf58148274b13da93a7cf13470f35 Mon Sep 17 00:00:00 2001 From: ogerly Date: Tue, 14 Jun 2022 13:35:11 +0200 Subject: [PATCH] changes db types --- admin/src/components/ContributionLinkForm.vue | 4 +-- admin/src/graphql/createContributionLink.js | 2 +- .../src/graphql/arg/ContributionLinkArgs.ts | 4 +-- .../graphql/arg/CreateContributionLinkArgs.ts | 29 ------------------- 4 files changed, 5 insertions(+), 34 deletions(-) delete mode 100644 backend/src/graphql/arg/CreateContributionLinkArgs.ts diff --git a/admin/src/components/ContributionLinkForm.vue b/admin/src/components/ContributionLinkForm.vue index b13725d64..21afe043a 100644 --- a/admin/src/components/ContributionLinkForm.vue +++ b/admin/src/components/ContributionLinkForm.vue @@ -131,7 +131,7 @@ export default { validFrom: null, validTo: null, cycle: 'ONCE', - maxPerCycle: '1', + maxPerCycle: 1, maxAmountPerMonth: '0', }, min: new Date(), @@ -158,7 +158,7 @@ export default { if (this.form.validFrom === null) return this.toastError(this.$t('contributionLink.noStartDate')) if (this.form.validTo === null) return this.toastError(this.$t('contributionLink.noEndDate')) - alert(JSON.stringify(this.form)) + // alert(JSON.stringify(this.form)) this.$apollo .mutate({ mutation: createContributionLink, diff --git a/admin/src/graphql/createContributionLink.js b/admin/src/graphql/createContributionLink.js index 51931b039..fb6728243 100644 --- a/admin/src/graphql/createContributionLink.js +++ b/admin/src/graphql/createContributionLink.js @@ -8,7 +8,7 @@ export const createContributionLink = gql` $amount: Decimal! $memo: String! $cycle: String! - $maxPerCycle: String + $maxPerCycle: Int! = 1 $maxAmountPerMonth: Decimal ) { createContributionLink( diff --git a/backend/src/graphql/arg/ContributionLinkArgs.ts b/backend/src/graphql/arg/ContributionLinkArgs.ts index 9a2c88a77..7344a28ff 100644 --- a/backend/src/graphql/arg/ContributionLinkArgs.ts +++ b/backend/src/graphql/arg/ContributionLinkArgs.ts @@ -24,6 +24,6 @@ export default class ContributionLinkArgs { @Field(() => Decimal, { nullable: true }) maxAmountPerMonth: Decimal | null - @Field(() => Int, { nullable: true }) - maxPerCycle: number | null + @Field(() => Int) + maxPerCycle: number } diff --git a/backend/src/graphql/arg/CreateContributionLinkArgs.ts b/backend/src/graphql/arg/CreateContributionLinkArgs.ts deleted file mode 100644 index a96fb158f..000000000 --- a/backend/src/graphql/arg/CreateContributionLinkArgs.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { ArgsType, Field, InputType } from 'type-graphql' - -@InputType() -@ArgsType() -export default class CreateContributionLinkArgs { - @Field(() => String) - validFrom: string - - @Field(() => String, { nullable: true }) - validTo: string | null - - @Field(() => String) - name: string - - @Field(() => String) - amount: string - - @Field(() => String) - memo: string - - @Field(() => String) - cycle: string - - @Field(() => String, { nullable: true }) - maxPerCycle: string | null - - @Field(() => String, { nullable: true }) - maxAmountPerMonth: string | null -}