diff --git a/src/lambda/get-career/index.py b/src/lambda/get-career/index.py index 3f8295c39..ce7f175a2 100644 --- a/src/lambda/get-career/index.py +++ b/src/lambda/get-career/index.py @@ -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() diff --git a/src/lambda/post-application/index.py b/src/lambda/post-application/index.py index 52a0d5ee1..aef0bd89f 100644 --- a/src/lambda/post-application/index.py +++ b/src/lambda/post-application/index.py @@ -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} } } }