Skip to content
Snippets Groups Projects

Revert "change to proper action"

Merged Jørgen Rosager requested to merge revert-ac57faca into master
1 file
+ 3
6
Compare changes
  • Side-by-side
  • Inline
@@ -3,10 +3,7 @@ import { StudentCity } from "../../store/studentCity/interfaces";
import { Text, View } from "../Themed";
import { Badge } from "react-native-elements";
import { useActions } from "../../hooks/useActions";
import {
fetchStudentCity,
setStudentCity,
} from "../../store/studentCity/actions";
import { setStudentCity } from "../../store/studentCity/actions";
import { TouchableOpacity } from "react-native-gesture-handler";
import Rating from "../Rating";
import StarRating from "../Rating/StarRating";
@@ -20,13 +17,13 @@ type Props = {
* Component for showing data for one student city given as a prop.
*/
const StudentCityCard = ({ studentCity, navigation }: Props) => {
const actions = useActions({ fetchStudentCity });
const actions = useActions({ setStudentCity });
return (
<TouchableOpacity
key={studentCity.id}
onPress={() => {
actions.fetchStudentCity(studentCity.id); // don't need to fetch again here
actions.setStudentCity(studentCity); // don't need to fetch again here
navigation.navigate("StudentCity");
}}
>
Loading