Skip to content

Commit

Permalink
feat: adding applicant count
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonNotJson committed Nov 16, 2023
1 parent 4fe0ac8 commit b29f91e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/lambda/get-career/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ def get_career(job_type):
company_logo = generate_url(bucket, company_logo_key)
item['hero_image'] = hero_image
item['company_logo'] = company_logo

if 'applicants' in item:
count = len(item['applicants'])
item['applicant_count'] = count

else:
item['applicant_count'] = 0

body = JsonPayloadBuilder().add_status(
True).add_data(response).add_message("").compile()
Expand Down
4 changes: 2 additions & 2 deletions src/lambda/post-application/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def post_application(application, uid):
"created_at": {"S": application["created_at"]},
},
'UpdateExpression': 'ADD applicants :uid',
'ConditionExpression': 'attribute_not_exists(applicants) OR NOT contains(applicants, :uid)',
'ConditionExpression': 'NOT contains(applicants, :uid)',
'ExpressionAttributeValues': {
':uid': {"S": uid}
':uid': {"SS": uid}
}
}
}
Expand Down

0 comments on commit b29f91e

Please sign in to comment.