@@ -475,7 +475,7 @@ export default class RecruitCRMService {
475475 const responseMapping = {
476476 phone : candidate . contact_number ,
477477 resume : candidate . resume ,
478- availability : _ . isNill ( candidate . available_from ) ? true
478+ availability : _ . isNil ( candidate . available_from ) ? true
479479 : new Date ( candidate . available_from ) <= new Date ( ) ,
480480 } ;
481481 return res . send ( responseMapping ) ;
@@ -512,10 +512,8 @@ export default class RecruitCRMService {
512512 const candidateSlug = candidate . slug ;
513513 const form = {
514514 contact_number : body . phone ,
515- available_from : body . availability ? new Date ( ) . toISOString ( ) : new Date ( '2100-01-01' ) . toISOString ( ) ,
515+ available_from : body . availability === 'true' ? new Date ( ) . toISOString ( ) : new Date ( '2100-01-01' ) . toISOString ( ) ,
516516 } ;
517- // assign required fields for update operation
518- _ . assign ( form , _ . pick ( candidate , [ 'first_name' , 'last_name' , 'email' , 'language_skills' ] ) ) ;
519517 // update candidate profile
520518 const response = await fetch ( `${ this . private . baseUrl } /v1/candidates/${ candidateSlug } ` , {
521519 method : 'POST' ,
@@ -572,7 +570,10 @@ export default class RecruitCRMService {
572570 * @param {string } email email address of the user.
573571 */
574572 async getCandidateByEmail ( email ) {
575- const url = `${ this . private . baseUrl } /v1/candidates/search?email=${ email } ` ;
573+ const query = {
574+ email,
575+ } ;
576+ const url = `${ this . private . baseUrl } /v1/candidates/search?${ qs . stringify ( query ) } ` ;
576577 const response = await fetch ( url , {
577578 method : 'GET' ,
578579 headers : {
0 commit comments