@@ -11,22 +11,22 @@ const Spurwing = (function() {
1111 return this
1212 }
1313
14- this . get_appointment_types = async function ( provider_id , clients_can_book ) {
15- return await this . HTTP ( 'GET' , this . API_URL + 'appointment_types.json' , { provider_id, clients_can_book } )
14+ this . get_appointment_types = async function ( provider_id , page_size , offset ) {
15+ return await this . HTTP ( 'GET' , this . API_URL + 'appointment_types.json' , { provider_id, page_size , offset } )
1616 }
17- this . get_days_available = async function ( provider_id , appointment_type_id , date_from_month , timezone , org_level ) {
18- return await this . HTTP ( 'GET' , this . API_URL + 'bookings/days_available.json' , { provider_id, appointment_type_id, date_from_month, timezone , org_level } )
17+ this . get_days_available = async function ( provider_id , appointment_type_id , date_from_month , organization_level , timezone ) {
18+ return await this . HTTP ( 'GET' , this . API_URL + 'bookings/days_available.json' , { provider_id, appointment_type_id, date_from_month, organization_level , timezone } )
1919 }
20- this . get_slots_available = async function ( provider_id , appointment_type_id , start_date , end_date , org_level ) {
21- return await this . HTTP ( 'GET' , this . API_URL + 'bookings/slots_available.json' , { provider_id, appointment_type_id, start_date, end_date, org_level } )
20+ this . get_slots_available = async function ( provider_id , appointment_type_id , start_date , end_date , organization_level , timezone ) {
21+ return await this . HTTP ( 'GET' , this . API_URL + 'bookings/slots_available.json' , { provider_id, appointment_type_id, start_date, end_date, organization_level , timezone } )
2222 }
23- this . complete_booking = async function ( provider_id , appointment_type_id , date , timezone , first_name , last_name , email , phone_number , contact_type ) {
24- return await this . HTTP ( 'POST' , this . API_URL + 'bookings/complete_booking.json' , { provider_id, appointment_type_id, date , timezone , first_name, last_name, email , phone_number , contact_type } )
23+ this . complete_booking = async function ( provider_id , appointment_type_id , email , first_name , last_name , date , contact_type , appointment_id , appointment_location_id , timezone , video_chat_url ) {
24+ return await this . HTTP ( 'POST' , this . API_URL + 'bookings/complete_booking.json' , { provider_id, appointment_type_id, email , first_name, last_name, date , contact_type , appointment_id , appointment_location_id , timezone , video_chat_url } )
2525 }
26- this . list_appointments = async function ( authorization , page_size , offset , provider_id ) {
27- return await this . HTTP ( 'GET' , this . API_URL + 'appointments' , { page_size, offset, provider_id } , { authorization : 'Bearer ' + authorization } )
26+ this . list_appointments = async function ( authorization , page_size , offset , appointment_category , load_attendees , load_providers , load_appointment_type ) {
27+ return await this . HTTP ( 'GET' , this . API_URL + 'appointments' , { page_size, offset, appointment_category , load_attendees , load_providers , load_appointment_type } , { authorization : 'Bearer ' + authorization } )
2828 }
29- this . delete_appointment = async function ( appointment_id , authorization ) {
29+ this . delete_appointment = async function ( authorization , appointment_id ) {
3030 return await this . HTTP ( 'DELETE' , this . API_URL + 'appointments/' + appointment_id , { } , { authorization : 'Bearer ' + authorization } )
3131 }
3232
@@ -66,8 +66,11 @@ const Spurwing = (function() {
6666 if ( ! obj )
6767 return '' ;
6868 let urlData = '' ;
69- for ( let x in obj )
69+ for ( let x in obj ) {
70+ if ( typeof obj [ x ] === 'undefined' || obj [ x ] == null )
71+ continue ;
7072 urlData = urlData + x + '=' + encodeURIComponent ( obj [ x ] ) + '&' ;
73+ }
7174 urlData = urlData . substr ( 0 , ( urlData . length - 1 ) ) ;
7275 return urlData ;
7376 }
0 commit comments