File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -70,11 +70,7 @@ pub async fn scrape_${name.toLowerCase()}(data: &mut Data) -> Result<JobsPayload
7070 serde_json::from_str(remote_object.value.unwrap().as_str().unwrap()).unwrap();
7171
7272 // Convert Vector of ScrapedJob into a JobsPayload
73- let jobs_payload = JobsPayload::from_scraped_jobs(scraped_jobs, &data.data["${ dataKey } "]);
74-
75- // REMEBER TO SAVE THE NEW JOBS TO THE DATA STATE
76- data.data.get_mut("${ dataKey } ").unwrap().jobs = jobs_payload.all_jobs.clone();
77- data.save();
73+ let jobs_payload = JobsPayload::from_scraped_jobs(scraped_jobs, "${ dataKey } ", data);
7874
7975 // Return JobsPayload
8076 Ok(jobs_payload)
@@ -137,11 +133,7 @@ JSON.stringify(jobs);
137133 serde_json::from_str(remote_object.value.unwrap().as_str().unwrap()).unwrap();
138134
139135 // Convert Vector of ScrapedJob into a JobsPayload
140- let jobs_payload = JobsPayload::from_scraped_jobs(scraped_jobs, &data.data["${ dataKey } "]);
141-
142- // REMEBER TO SAVE THE NEW JOBS TO THE DATA STATE
143- data.data.get_mut("${ dataKey } ").unwrap().jobs = jobs_payload.all_jobs.clone();
144- data.save();
136+ let jobs_payload = JobsPayload::from_scraped_jobs(scraped_jobs, "${ dataKey } ", data);
145137
146138 // Return JobsPayload
147139 Ok(jobs_payload)
You can’t perform that action at this time.
0 commit comments