22.flex.gap-5
33 .flex.flex-col ( class ="w-1/6" )
44 .flex.flex-col.py-4.font-bold
5- button.border.border-gray-200.rounded-lg.p-2.whitespace-nowrap ( @click ="downloadContacts()" class ="hover:bg-blue-600 hover:text-white" ) Download Contacts
5+ button.border.border-gray-200.rounded-lg.p-2.whitespace-nowrap ( @click ="downloadContacts()" class ="hover:bg-blue-600 hover:text-white" ) Download All Contacts
66 .flex.flex-col.py-4.font-bold
77 strong Tags
88 Multiselect(
@@ -174,7 +174,7 @@ const constructQueryParams = () => {
174174 tag: tagsQueryParam ,
175175 cursor: cursors .value [currentPage .value ] + ' ' ,
176176 pageSize: pageSize .value + ' ' ,
177- showRemoved: filters .value .showRemoved ,
177+ showRemoved: String ( filters .value .showRemoved ) ,
178178 });
179179 console .log (" startdate with isostring" , filters .value .startDate );
180180 console .log (" enddate with iostring" , filters .value .endDate );
@@ -201,9 +201,8 @@ const fetchContacts = async () => {
201201// NOTE FOR TAZ: this should ideally be computed coming off a useFetch
202202onMounted (() => fetchContacts ());
203203const downloadContacts = async () => {
204- const queryParams = constructQueryParams ();
205204 // Using the `query` in the fetch URL
206- const response = await fetch (` /api/contacts?${ queryParams } ` , {
205+ const response = await fetch (` /api/all- contacts ` , {
207206 method: ' GET' ,
208207 });
209208
@@ -213,7 +212,31 @@ const downloadContacts = async () => {
213212 }
214213
215214 const contacts = await response .json ();
216- const headers = Object .keys (contacts [0 ]);
215+ const headers = [
216+ " lastName" ,
217+ " firstName" ,
218+ " middleName" ,
219+ " prefix" ,
220+ " suffix" ,
221+ " company" ,
222+ " professionalTitle" ,
223+ " address1" ,
224+ " city1" ,
225+ " state1" ,
226+ " zipCode1" ,
227+ " address1Type" ,
228+ " address2" ,
229+ " city2" ,
230+ " state2" ,
231+ " zipCode2" ,
232+ " address2Type" ,
233+ " mainPhone" ,
234+ " directPhone" ,
235+ " mobilePhone" ,
236+ " emailAddress" ,
237+ " narrative" ,
238+ " tag"
239+ ]
217240
218241 const reduced = contacts .reduce (
219242 (acc : string , curr : any ) => {
0 commit comments