Skip to content

Commit 09b6880

Browse files
authored
Merge pull request #154 from uw-ssec/feat/native-survey-json-support
[Feature]: Native Survey Json Support
2 parents a01fb7d + aecb633 commit 09b6880

File tree

4 files changed

+1390
-1359
lines changed

4 files changed

+1390
-1359
lines changed

client/src/pages/Survey/Survey.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { initializeSurvey } from './utils/surveyUtils';
2626
// It uses the useEffect hook to manage side effects, such as fetching data and updating state
2727
// It uses the useGeolocated hook to get the user's geolocation
2828
const Survey = () => {
29-
const { surveyService, locationService, seedService } = useApi();
29+
const { surveyService, seedService } = useApi();
3030
const [searchParams] = useSearchParams();
3131
const surveyCodeInUrl = searchParams.get('ref');
3232
const { id: surveyObjectIdInUrl } = useParams();
@@ -43,10 +43,6 @@ const Survey = () => {
4343
// Add a ref to store the original full survey data in edit mode
4444
const originalSurveyData = useRef<any>(null);
4545

46-
// Get locations with loading state
47-
const { data: locations, isLoading: locationsLoading } =
48-
locationService.useLocations() || {};
49-
5046
// Conditionally fetch survey by referral code (only when surveyCodeInUrl exists)
5147
const { data: surveyByRefCode, isLoading: surveyByRefLoading } =
5248
surveyCodeInUrl
@@ -203,8 +199,6 @@ const Survey = () => {
203199

204200
// Check if all required data is loaded
205201
const isDataReady =
206-
!locationsLoading &&
207-
locations &&
208202
(!surveyCodeInUrl || !surveyByRefLoading) &&
209203
!parentLoading &&
210204
!surveyByObjectIdLoading;
@@ -283,7 +277,6 @@ const Survey = () => {
283277
surveyByRefCode,
284278
surveyByObjectId,
285279
parentSurvey,
286-
locations,
287280
ability
288281
]);
289282

@@ -304,7 +297,6 @@ const Survey = () => {
304297

305298
// Loading state (need to fetch all data)
306299
const isLoading =
307-
locationsLoading ||
308300
(surveyCodeInUrl && surveyByRefLoading) ||
309301
parentLoading ||
310302
// seedLoading ||

0 commit comments

Comments
 (0)