diff --git a/template/app/main.wasp b/template/app/main.wasp index 47c31884..d3364e87 100644 --- a/template/app/main.wasp +++ b/template/app/main.wasp @@ -90,7 +90,7 @@ app OpenSaaS { */ entity User {=psl - id Int @id @default(autoincrement()) + id String @id @default(uuid()) createdAt DateTime @default(now()) email String? @unique @@ -118,7 +118,7 @@ entity GptResponse {=psl updatedAt DateTime @updatedAt user User @relation(fields: [userId], references: [id]) - userId Int + userId String content String psl=} @@ -128,7 +128,7 @@ entity Task {=psl createdAt DateTime @default(now()) user User @relation(fields: [userId], references: [id]) - userId Int + userId String description String time String @default("1") @@ -140,7 +140,7 @@ entity File {=psl createdAt DateTime @default(now()) user User @relation(fields: [userId], references: [id]) - userId Int + userId String name String type String @@ -155,7 +155,7 @@ entity ContactFormMessage {=psl createdAt DateTime @default(now()) user User @relation(fields: [userId], references: [id]) - userId Int + userId String content String isRead Boolean @default(false) diff --git a/template/app/src/server/actions.ts b/template/app/src/server/actions.ts index ddeb89bd..fa4ba124 100644 --- a/template/app/src/server/actions.ts +++ b/template/app/src/server/actions.ts @@ -286,7 +286,7 @@ export const deleteTask: DeleteTask, Task> = async ({ id }, con return task; }; -export const updateUserById: UpdateUserById<{ id: number; data: Partial }, User> = async ( +export const updateUserById: UpdateUserById<{ id: string; data: Partial }, User> = async ( { id, data }, context ) => { @@ -318,7 +318,7 @@ export const createFile: CreateFile = async ({ fileType, name }, throw new HttpError(401); } - const userInfo = context.user.id.toString(); + const userInfo = context.user.id; const { uploadUrl, key } = await getUploadFileSignedURLFromS3({ fileType, userInfo });