WaspW
Wasp2y ago
JLegendz

New user fields not recognized

I'm attempting to add some attributes to my user entity that have a relation to other entity attributes.

entity User {=psl
  id                        Int             @id @default(autoincrement())
  createdAt                 DateTime        @default(now())

  email                     String?         @unique
  username                  String?         @unique
  lastActiveTimestamp       DateTime        @default(now())
  isAdmin                   Boolean         @default(false)

  stripeId                  String?
  checkoutSessionId         String?
  subscriptionTier          String?
  subscriptionStatus        String?
  sendEmail                 Boolean         @default(false)
  datePaid                  DateTime?
  credits                   Int             @default(3)

  gptResponses              GptResponse[]
  contactFormMessages       ContactFormMessage[]
  tasks                     Task[]
  files                     File[]

  subscriptions             Listing[]       @relation("UserSubscriptions")
  listings                  Listing[]      
  advertisements            Advertisement[]
  claims                    Advertisement[] @relation("UserClaims")
 
psl=}


subscriptions and claims are the new addition I'm adding.

On one of my pages where I'm already reading user.credits, I'm also trying to read user.subscriptions, but I get the following error:

[ Wasp ] ext-src/client/app/ListingDetailsPage.tsx(61,25): error TS2551: Property 'subscriptions' does not exist on type 'AuthUser'. Did you mean 'subscriptionTier'?
Was this page helpful?