From 9e56383b4600b07c7b0edbfc47a51549889bc659 Mon Sep 17 00:00:00 2001 From: Finn Date: Mon, 18 Sep 2017 11:34:22 +0100 Subject: [PATCH] User and Register API errors improved --- lib/Pear/LocalLoop/Controller/Api/Register.pm | 20 +++++++++---------- lib/Pear/LocalLoop/Controller/Api/User.pm | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/Pear/LocalLoop/Controller/Api/Register.pm b/lib/Pear/LocalLoop/Controller/Api/Register.pm index 8ba4f11..822087d 100644 --- a/lib/Pear/LocalLoop/Controller/Api/Register.pm +++ b/lib/Pear/LocalLoop/Controller/Api/Register.pm @@ -9,18 +9,18 @@ has error_messages => sub { in_resultset => { message => 'Token invalid or has been used.', status => 401 }, }, name => { - required => { message => 'No name sent or was blank.', status => 400 }, + required => { message => 'No organisation name sent or was blank.', status => 400 }, }, display_name => { - required => { message => 'No name sent or was blank.', status => 400 }, + required => { message => 'No display name sent or was blank.', status => 400 }, }, full_name => { - required => { message => 'No name sent or was blank.', status => 400 }, + required => { message => 'No full name sent or was blank.', status => 400 }, }, email => { required => { message => 'No email sent.', status => 400 }, email => { message => 'Email is invalid.', status => 400 }, - not_in_resultset => { message => 'Email exists.', status => 403 }, + not_in_resultset => { message => 'Email already in use.', status => 403 }, }, postcode => { required => { message => 'No postcode sent.', status => 400 }, @@ -34,16 +34,16 @@ has error_messages => sub { in => { message => '"usertype" is invalid.', status => 400 }, }, year_of_birth => { - required => { message => 'No year_of_birth sent.', status => 400 }, - number => { message => 'year_of_birth is invalid', status => 400 }, - gt_num => { message => 'year_of_birth must be within last 150 years', status => 400 }, - lt_num => { message => 'year_of_birth must be atleast 10 years ago', status => 400 }, + required => { message => 'No year of birth sent.', status => 400 }, + number => { message => 'year of birth is invalid', status => 400 }, + gt_num => { message => 'year of birth must be within last 150 years', status => 400 }, + lt_num => { message => 'year of birth must be atleast 10 years ago', status => 400 }, }, street_name => { - required => { message => 'No street_name sent.', status => 400 }, + required => { message => 'No street name sent.', status => 400 }, }, town => { - required => { message => 'No town sent.', status => 400 }, + required => { message => 'No town/city sent.', status => 400 }, }, }; }; diff --git a/lib/Pear/LocalLoop/Controller/Api/User.pm b/lib/Pear/LocalLoop/Controller/Api/User.pm index 0c0a2f3..d85e2d8 100644 --- a/lib/Pear/LocalLoop/Controller/Api/User.pm +++ b/lib/Pear/LocalLoop/Controller/Api/User.pm @@ -28,10 +28,10 @@ has error_messages => sub { required => { message => 'No password sent.', status => 400 }, }, street_name => { - required => { message => 'No street_name sent.', status => 400 }, + required => { message => 'No street name sent.', status => 400 }, }, town => { - required => { message => 'No town sent.', status => 400 }, + required => { message => 'No town/city sent.', status => 400 }, }, sector => { required => { message => 'No sector sent.', status => 400 },