Skip to content

Commit

Permalink
Fix: api database changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-sumi-k committed Nov 1, 2023
1 parent 4cb48b6 commit 231aa6f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-frontend-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions-frontend-access
aws-region: ap-south-1

- name: Build frontend and push on ECR
- name: Build frontend and copy to S3
run: |
cd nuxt-frontend
sed -i "s|VITE_IFRAMELY_KEY_VALUE|${{ secrets.IFRAMELY_KEY }}|g" config.prod.js
Expand Down
2 changes: 1 addition & 1 deletion db/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func NewSql() *sqlx.DB {
sslmode = "disable"
}

db = sqlx.MustConnect("postgres", "postgres://"+username+":"+password+"@"+host+":"+port+"?sslmode="+sslmode)
db = sqlx.MustConnect("postgres", "postgres://"+username+":"+password+"@"+host+":"+port+"/"+name+"?sslmode="+sslmode)

db.Mapper = reflectx.NewMapperFunc("json", strings.ToLower)
db.SetConnMaxLifetime(time.Minute * 1)
Expand Down
2 changes: 1 addition & 1 deletion jobs/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (repository *CareerRepository) SaveApplicationsData(c *gin.Context) {
func (repository *CareerRepository) InsertJobApplication(input JobsApplicationsDetails) error {

// Upload resume to S3
resumeURL, err := utils.UploadResumeToS3(input.File)
resumeURL, err := utils.UploadResumeToS3(input.File, input.Email)
if err != nil {
log.Error(err)
return err
Expand Down
4 changes: 2 additions & 2 deletions utils/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func UploadFileToS3(fileName string, sess *session.Session) {
return
}

func UploadResumeToS3(fileHeader *multipart.FileHeader) (string, error) {
func UploadResumeToS3(fileHeader *multipart.FileHeader, email string) (string, error) {
file, err := fileHeader.Open()
if err != nil {
return "", err
Expand All @@ -118,7 +118,7 @@ func UploadResumeToS3(fileHeader *multipart.FileHeader) (string, error) {

params := &s3.PutObjectInput{
Bucket: aws.String("canopas-website"),
Key: aws.String("resumes/" + fileName),
Key: aws.String("resumes/" + email + "_" + fileName),
Body: file,
ACL: aws.String("public-read"),
}
Expand Down

0 comments on commit 231aa6f

Please sign in to comment.