Skip to content

Commit

Permalink
fix: add object url to avatar in profile search
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielzxccc committed Dec 18, 2023
1 parent e81b332 commit ec86e9c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/modules/Users/UserInteractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ import HttpError from '../../utils/HttpError'
import * as Service from './UserService'
import { deleteFile } from '../../utils/file'
import dbErrorHandler from '../../utils/dbErrorHandler'
import { getObjectUrl } from '../AWS-Bucket/UploadService'

export async function findUserProfile(username: string) {
const user = await Service.findByEmailOrUsername(username)
if (!user) throw new HttpError('User not found', 404)
delete user.password
user.avatar = getObjectUrl(user.avatar)

return user
}

Expand Down

0 comments on commit ec86e9c

Please sign in to comment.