From a8ea534f13cc23dfab25c6d856f9d9833dd000ba Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Sat, 14 Jan 2023 17:06:55 +1100
Subject: Add 'imgonly' server query param

Remove script for deleting events in db without images
---
 src/components/SearchModal.vue | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'src/components/SearchModal.vue')

diff --git a/src/components/SearchModal.vue b/src/components/SearchModal.vue
index 069797b..dd387e1 100644
--- a/src/components/SearchModal.vue
+++ b/src/components/SearchModal.vue
@@ -93,11 +93,13 @@ async function onInput(){
 		input: input.value,
 		limit: String(store.searchSuggLimit),
 	});
-	// Check if any event categories are disabled
-	if (Object.values(store.ctgs).some((b: boolean) => !b)){
+	if (Object.values(store.ctgs).some((b: boolean) => !b)){ // If any event categories are disabled
 		let visibleCtgs = Object.entries(store.ctgs).filter(([, enabled]) => enabled).map(([ctg, ]) => ctg);
 		urlParams.append('ctgs', visibleCtgs.join('.'));
 	}
+	if (store.reqImgs){
+		urlParams.append('imgonly', 'true');
+	}
 	// Code for querying server
 	pendingReqParams.value = urlParams;
 	pendingReqInput.value = input.value;
@@ -174,6 +176,9 @@ async function resolveSearch(eventTitle: string){
 	if (visibleCtgs != null){
 		urlParams.append('ctgs', visibleCtgs.join('.'));
 	}
+	if (store.reqImgs){
+		urlParams.append('imgonly', 'true');
+	}
 	let responseObj: EventInfoJson | null = await queryServer(urlParams);
 	if (responseObj != null){
 		let eventInfo = jsonToEventInfo(responseObj);
-- 
cgit v1.2.3

