Skip to content

Commit

Permalink
adding standart photo
Browse files Browse the repository at this point in the history
  • Loading branch information
MatheusSanchez committed Feb 3, 2024
1 parent 0fa3632 commit 4cf9c7e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
Warnings:
- Made the column `avatar_url` on table `User` required. This step will fail if there are existing NULL values in that column.
*/
-- AlterTable
ALTER TABLE "User" ALTER COLUMN "avatar_url" SET NOT NULL,
ALTER COLUMN "avatar_url" SET DEFAULT 'https://orangeapp-contents-prod.s3.amazonaws.com/avatar1.png';
2 changes: 1 addition & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ model User {
surname String?
email String @unique
password_hash String
avatar_url String?
avatar_url String @default("https://orangeapp-contents-prod.s3.amazonaws.com/avatar1.png")
is_google Boolean @default(false)
created_at DateTime @default(now())
updated_at DateTime @updatedAt
Expand Down
2 changes: 1 addition & 1 deletion src/controller/project/getProjectById.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('Get Projets By ID E2E', () => {
expect(getProjectByIdResponse.body.project).toEqual(
expect.objectContaining({
title,
user: { name: 'John', surname: 'Doe', avatar_url: null },
user: { name: 'John', surname: 'Doe', avatar_url: expect.any(String) },
tags,
}),
)
Expand Down
6 changes: 3 additions & 3 deletions src/controller/project/getProjectsByTags.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ describe('Get Projets By Tags E2E', () => {
expect(getProjectsByTagsResponse.body.projects[0]).toEqual(
expect.objectContaining({
title: 'Project 01',
user: { name: 'John', surname: 'Doe', avatar_url: null },
user: { name: 'John', surname: 'Doe', avatar_url: expect.any(String) },
}),
)
expect(getProjectsByTagsResponse.body.projects[1]).toEqual(
expect.objectContaining({
title: 'Project 02',
user: { name: 'John', surname: 'Doe', avatar_url: null },
user: { name: 'John', surname: 'Doe', avatar_url: expect.any(String) },
}),
)
})
Expand Down Expand Up @@ -105,7 +105,7 @@ describe('Get Projets By Tags E2E', () => {
expect(getProjectsByTagsResponse.body.projects[0]).toEqual(
expect.objectContaining({
title: 'Project 03',
user: { name: 'John', surname: 'Doe', avatar_url: null },
user: { name: 'John', surname: 'Doe', avatar_url: expect.any(String) },
}),
)
})
Expand Down

0 comments on commit 4cf9c7e

Please sign in to comment.