#Prisma default value

2 messages · Page 1 of 1 (latest)

grave sleet
#

I have this model

model Asyncrequestreply {
  id   String @id @default(auto()) @map("_id") @db.ObjectId
  data Json   @db.Json
  // the location defaults to the id of the request
  localtion String @default() // <-- I want this to be a "url/" + id

  retryAt DateTime @db.Date
  status Status @default(PENDING)

  createdAt DateTime @default(now()) @db.Date
  updatedAt DateTime @default(now()) @updatedAt @db.Date
}

I simply want to add whatever the id is to the end of my location field. so I end up with something like this /endpoint/1283

there is no obvious way to do it.

lean halo
#

You can use that on your controller/service i guess, like: http:${url}