Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Bug Report: use enum in PurchasePage.tsx #8639

Open
yuval-hazaz opened this issue Jun 14, 2024 · 0 comments
Open

馃悰 Bug Report: use enum in PurchasePage.tsx #8639

yuval-hazaz opened this issue Jun 14, 2024 · 0 comments
Labels
type: bug Something isn't working

Comments

@yuval-hazaz
Copy link
Member

What happened?

Ideally we should use the Enum for provisionStatus and not an hardcoded string.

Update server to return the correct enum in ProvisionSubscriptionResult as follow:

import { Field, ObjectType, registerEnumType } from "@nestjs/graphql";
import { ProvisionSubscriptionStatus } from "@stigg/node-server-sdk";

@ObjectType({
  isAbstract: true,
})
export class ProvisionSubscriptionResult {
  @Field(() => ProvisionSubscriptionStatus, {
    nullable: false,
  })
  provisionStatus!: ProvisionSubscriptionStatus;

  @Field(() => String, {
    nullable: true,
  })
  checkoutUrl?: string;
}

registerEnumType(ProvisionSubscriptionStatus, {
  name: "ProvisionSubscriptionStatus",
});

What you expected to happen

export the enum from the server, or use the types from stigg on the client

How to reproduce

see [amplication-client/src/Purchase/PurchasePage.tsx

Amplication version

No response

Environment

No response

Are you willing to submit PR?

No response

@yuval-hazaz yuval-hazaz added the type: bug Something isn't working label Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant