upd: tampilan
Deskripsi: - masang toast - ganti tag Text No Issues
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import ButtonBackHeader from "@/components/buttonBackHeader";
|
||||
import ButtonSaveHeader from "@/components/buttonSaveHeader";
|
||||
import { InputForm } from "@/components/inputForm";
|
||||
import Text from "@/components/Text";
|
||||
import Styles from "@/constants/Styles";
|
||||
import { apiEditBanner, apiGetBanner, apiGetBannerOne } from "@/lib/api";
|
||||
import { setEntities } from "@/lib/bannerSlice";
|
||||
@@ -14,10 +15,9 @@ import {
|
||||
Pressable,
|
||||
SafeAreaView,
|
||||
ScrollView,
|
||||
Text,
|
||||
ToastAndroid,
|
||||
View,
|
||||
View
|
||||
} from "react-native";
|
||||
import Toast from "react-native-toast-message";
|
||||
import { useDispatch } from "react-redux";
|
||||
|
||||
export default function EditBanner() {
|
||||
@@ -94,17 +94,17 @@ export default function EditBanner() {
|
||||
|
||||
const updatedEntity = await apiEditBanner(fd, id)
|
||||
if (updatedEntity.success) {
|
||||
ToastAndroid.show("Berhasil mengupdate data", ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: 'Berhasil mengupdate data', })
|
||||
apiGetBanner({ user: hasil }).then((data) =>
|
||||
dispatch(setEntities(data.data))
|
||||
);
|
||||
router.back();
|
||||
} else {
|
||||
ToastAndroid.show('Gagal mengupdate data', ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: 'Gagal mengupdate data', })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
ToastAndroid.show('Gagal mengupdate data', ToastAndroid.SHORT);
|
||||
Toast.show({ type: 'small', text1: 'Gagal mengupdate data', })
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user