All files / @nova/partenaire/store actions.js

79.31% Statements 46/58
100% Branches 0/0
58.62% Functions 17/29
100% Lines 29/29

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189                                                                                        1x         1x         1x         1x         1x         1x         1x         1x         1x       1x         1x         2x         1x           1x         1x       1x         1x         2x         1x           1x         1x         1x         1x         1x         1x         1x         1x         2x         1x        
import {
  SET_LOADING,
  SET_MODAL_VISIBLE,
  SET_MODAL_LOADING,
  FETCH_ADDRESSES,
  SET_ERRORS,
  SET_DELETE_STATUS,
  CREATE_DELETE_TASK,
 
  // emails
  SET_EMAILS,
  SET_ADD_EMAIL,
  SET_EDIT_EMAIL,
  CREATE_EMAIL_TASK,
  SET_PENDING_EMAIL,
  SET_EMAIL_TASK,
 
  // phones
  SET_PHONES,
  SET_ADD_PHONE,
  SET_EDIT_PHONE,
  CREATE_PHONE_TASK,
  SET_PENDING_PHONE,
  SET_PHONE_TASK,
 
  // postals
  SET_POSTALS,
  SET_EDIT_POSTAL,
  SET_PENDING_POSTAL,
  SET_PENDING_POSTAL_BY_ID,
 
  // bankings
  SET_BANKINGS,
  SET_EDIT_BANKING,
  SET_PENDING_BANKING,
  SET_PENDING_BANKING_BY_ID,
 
  // localities (postals + bankings)
  SET_SWISS_LOCALITY,
 
  // account register
  SET_REGISTRATION_REQUEST_SENT,
} from './constants';
 
export const setLoading = loading => ({
  type: SET_LOADING,
  payload: { loading },
});
 
export const setModalLoading = loading => ({
  type: SET_MODAL_LOADING,
  payload: { loading },
});
 
export const setErrors = errors => ({
  type: SET_ERRORS,
  payload: { errors },
});
 
export const setDeleteStatus = (subtype, idx) => ({
  type: SET_DELETE_STATUS,
  payload: { subtype, idx },
});
 
export const createDeleteTask = (subtype, idx) => ({
  type: CREATE_DELETE_TASK,
  payload: { subtype, idx },
});
 
export const setModalVisible = visible => ({
  type: SET_MODAL_VISIBLE,
  payload: { visible },
});
 
export const fetchAddresses = addressType => ({
  type: FETCH_ADDRESSES,
  payload: { addressType },
});
 
export const setEmails = emails => ({
  type: SET_EMAILS,
  payload: { emails },
});
 
export const setAddEmail = () => ({
  type: SET_ADD_EMAIL,
});
 
export const setEditEmail = idx => ({
  type: SET_EDIT_EMAIL,
  payload: { idx },
});
 
export const setPendingEmail = pending => ({
  type: SET_PENDING_EMAIL,
  payload: { pending },
});
 
export const setEmailTaskProcessing = (idx, email, nature, status) => ({
  type: SET_EMAIL_TASK,
  payload: { idx, email, nature, status },
});
 
export const createEmailTask = (addressId, email, nature) => ({
  type: CREATE_EMAIL_TASK,
  addressId,
  payload: { email, nature },
});
 
export const setPhones = phones => ({
  type: SET_PHONES,
  payload: { phones },
});
 
export const setAddPhone = () => ({
  type: SET_ADD_PHONE,
});
 
export const setEditPhone = idx => ({
  type: SET_EDIT_PHONE,
  payload: { idx },
});
 
export const setPendingPhone = pending => ({
  type: SET_PENDING_PHONE,
  payload: { pending },
});
 
export const setPhoneTaskProcessing = (idx, phone, nature, status) => ({
  type: SET_PHONE_TASK,
  payload: { idx, phone, nature, status },
});
 
export const createPhoneTask = (addressId, phoneNumber, nature) => ({
  type: CREATE_PHONE_TASK,
  addressId,
  payload: { phoneNumber, nature },
});
 
export const setPostals = postals => ({
  type: SET_POSTALS,
  payload: { postals },
});
 
export const setEditPostal = idx => ({
  type: SET_EDIT_POSTAL,
  payload: { idx },
});
 
export const setPendingPostal = pending => ({
  type: SET_PENDING_POSTAL,
  payload: { pending },
});
 
export const setPendingPostalById = (pending, addressId) => ({
  type: SET_PENDING_POSTAL_BY_ID,
  payload: { pending, addressId },
});
 
export const setBankings = bankings => ({
  type: SET_BANKINGS,
  payload: { bankings },
});
 
export const setEditBanking = idx => ({
  type: SET_EDIT_BANKING,
  payload: { idx },
});
 
export const setPendingBanking = pending => ({
  type: SET_PENDING_BANKING,
  payload: { pending },
});
 
export const setPendingBankingById = (pending, addressId) => ({
  type: SET_PENDING_BANKING_BY_ID,
  payload: { pending, addressId },
});
 
export const setSwissLocality = (idLocaliteCommune, locality, postalCode, addressType) => ({
  type: SET_SWISS_LOCALITY,
  payload: { idLocaliteCommune, locality, postalCode, addressType },
});
 
export const setRegistrationRequestSent = registrationRequestSent => ({
  type: SET_REGISTRATION_REQUEST_SENT,
  payload: { registrationRequestSent },
});