Skip to content

Commit

Permalink
Merge pull request #80 from jphacks/tomo/dummy-thumbnail
Browse files Browse the repository at this point in the history
デフォルトサムネイルの設置
  • Loading branch information
yuta-ike authored Oct 30, 2021
2 parents 6b37154 + 3d3dd58 commit f7a9b46
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/server/src/entity/File.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ type FileType = "own" | "shared"

@Entity()
export class File {
static DEFAULT_THUMBNAIL_URL = `https://${process.env.AWS_BUCKET_NAME}.s3.${process.env.AWS_REGION}.amazonaws.com/thumbnail/admin/default.png`

@PrimaryGeneratedColumn("uuid")
id: string

Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/handler/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const fileHandler = async (server: FastifyInstance) => {
fileModel.url = req.body.file.value
// fileModel.thumbnail =
// thumbnailUrl ?? "Thumbnail is generated only in production mode."
fileModel.thumbnail = "Thumbnail is generated only when use s3."
fileModel.thumbnail = File.DEFAULT_THUMBNAIL_URL
fileModel.author = req.currentUser
fileModel.updated_by = req.currentUser

Expand Down

0 comments on commit f7a9b46

Please sign in to comment.