Skip to content

[HELP] - creating two different pages of the same model #639

@SajeeTechi

Description

@SajeeTechi

@foyarash

// prisma/schema.prisma
enum Role {
  USER
  ADMIN
}
 
model User {
  id        Int      @id @default(autoincrement())
  email     String   @unique
  name      String?
  password  String   @default("")
  posts     Post[]   @relation("author") // One-to-many relation
  profile   Profile? @relation("profile") // One-to-one relation
  birthDate DateTime?
  createdAt DateTime @default(now())
  updatedAt DateTime @default(now()) @updatedAt
  role      Role     @default(USER)
}

For the User model, do you have a suggestion on how to create two different list views of the User model ?
I'd like it to be two different pages in my webapp, example:

  1. /User
  2. /UserAdmin

The User model configuration for both routes is different in each case

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions