Add: - service/api-admin/api-master-admin.ts Fix: app/(application)/admin/app-information/business-field/[id]/index.tsx app/(application)/admin/app-information/business-field/create.tsx app/(application)/admin/app-information/index.tsx app/(application)/admin/app-information/information-bank/[id]/index.tsx app/(application)/admin/app-information/information-bank/create.tsx app/(application)/admin/maps.tsx screens/Admin/App-Information/BusinessFieldSection.tsx screens/Admin/App-Information/InformationBankSection.tsx screens/Admin/App-Information/StickerSection.tsx screens/Authentication/LoginView.tsx service/api-client/api-master.ts - Perbaikan berupa integrasi API ### No Issue
90 lines
2.4 KiB
TypeScript
90 lines
2.4 KiB
TypeScript
import {
|
|
BoxButtonOnFooter,
|
|
ButtonCustom,
|
|
StackCustom,
|
|
TextInputCustom,
|
|
ViewWrapper,
|
|
} from "@/components";
|
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
|
import { apiAdminMasterBankCreate } from "@/service/api-admin/api-master-admin";
|
|
import { router } from "expo-router";
|
|
import { useState } from "react";
|
|
import Toast from "react-native-toast-message";
|
|
|
|
export default function AdminAppInformation_BankCreate() {
|
|
const [data, setData] = useState<any>({
|
|
namaBank: "",
|
|
namaAkun: "",
|
|
norek: "",
|
|
});
|
|
|
|
const [isLoading, setLoading] = useState(false);
|
|
|
|
const handlerSubmit = async () => {
|
|
try {
|
|
setLoading(true);
|
|
const response = await apiAdminMasterBankCreate({ data: data });
|
|
|
|
if (response.success) {
|
|
Toast.show({
|
|
type: "success",
|
|
text1: "Data berhasil di tambah",
|
|
});
|
|
router.back();
|
|
}
|
|
} catch (error) {
|
|
console.log("[ERROR]", error);
|
|
Toast.show({
|
|
type: "error",
|
|
text1: "Gagal tambah data",
|
|
});
|
|
} finally {
|
|
setLoading(false);
|
|
}
|
|
};
|
|
|
|
const buttonSubmit = (
|
|
<BoxButtonOnFooter>
|
|
<ButtonCustom isLoading={isLoading} onPress={handlerSubmit}>
|
|
Tambah
|
|
</ButtonCustom>
|
|
</BoxButtonOnFooter>
|
|
);
|
|
return (
|
|
<>
|
|
<ViewWrapper footerComponent={buttonSubmit}>
|
|
<StackCustom>
|
|
<AdminBackButtonAntTitle title="Tambah Daftar Bank" />
|
|
|
|
<StackCustom>
|
|
<TextInputCustom
|
|
label="Nama Bank"
|
|
placeholder="Masukan Nama Bank"
|
|
required
|
|
value={data.namaBank}
|
|
onChangeText={(value) => setData({ ...data, namaBank: value })}
|
|
/>
|
|
|
|
<TextInputCustom
|
|
label="Nama Rekening"
|
|
placeholder="Masukan Nama Rekening"
|
|
required
|
|
value={data.namaAkun}
|
|
onChangeText={(value) => setData({ ...data, namaAkun: value })}
|
|
/>
|
|
|
|
<TextInputCustom
|
|
keyboardType="numeric"
|
|
label="Nomor Rekening"
|
|
placeholder="Masukan Nomor Rekening"
|
|
required
|
|
value={data.norek}
|
|
onChangeText={(value) => setData({ ...data, norek: value })}
|
|
/>
|
|
</StackCustom>
|
|
</StackCustom>
|
|
</ViewWrapper>
|
|
</>
|
|
);
|
|
}
|