Merge branch 'develop' into 'devops-staging'
Develop See merge request empatnusabangsa/ppob/ppob-frontend!71
This commit is contained in:
commit
0efff4b14f
|
@ -56,6 +56,7 @@ export const DetailUser = observer(() => {
|
|||
await Promise.allSettled([
|
||||
store.transaction.getDataHistoryTopUp(id),
|
||||
store.authentication.getProfit(id),
|
||||
store.authentication.getProfile(),
|
||||
store.transaction.getDetailHistoryTransaction(id),
|
||||
store.membership.getDetail(id),
|
||||
store.role.getData(isAdmin),
|
||||
|
@ -254,7 +255,7 @@ export const DetailUser = observer(() => {
|
|||
const dataRoute = [
|
||||
{
|
||||
route: LINKS.MEMBERSHIP,
|
||||
name: "Keanggotaan"
|
||||
name: "Keanggotaan",
|
||||
},
|
||||
{
|
||||
route: LINKS.USER_DETAIL.replace(":id", id),
|
||||
|
@ -645,8 +646,9 @@ export const DetailUser = observer(() => {
|
|||
<Text strong>Foto Toko</Text>
|
||||
<Text>
|
||||
<Row>
|
||||
{store.authentication.listImage.map((item) => (
|
||||
{store.authentication.listImage.map((item, index) => (
|
||||
<Image
|
||||
key={index}
|
||||
src={
|
||||
item
|
||||
? `${appConfig.apiUrl}/config/image/${item}`
|
||||
|
@ -683,8 +685,9 @@ export const DetailUser = observer(() => {
|
|||
<Text strong>Foto Toko</Text>
|
||||
<Text>
|
||||
<Row>
|
||||
{store.authentication.listImage.map((item) => (
|
||||
{store.authentication.listImage.map((item, index) => (
|
||||
<Image
|
||||
key={index}
|
||||
src={
|
||||
item
|
||||
? `${appConfig.apiUrl}/config/image/${item}`
|
||||
|
|
|
@ -269,7 +269,7 @@ export const Membership = observer(() => {
|
|||
|
||||
if (initialData.id) {
|
||||
data.image_identity = image;
|
||||
data.image_store = imageStore;
|
||||
data.image_store = JSON.stringify(imageStore);
|
||||
}
|
||||
|
||||
if (initialData.id) {
|
||||
|
@ -280,7 +280,7 @@ export const Membership = observer(() => {
|
|||
const request = {
|
||||
...data,
|
||||
image_identity: image,
|
||||
image_store: imageStore,
|
||||
image_store: JSON.stringify(imageStore),
|
||||
};
|
||||
await store.membership.update(initialData.id, request);
|
||||
console.log(data, "edit data");
|
||||
|
|
|
@ -141,7 +141,7 @@ export const MembershipModal = ({
|
|||
name: res.body.filename,
|
||||
status: "done",
|
||||
url: `${appConfig.apiUrl}/config/image/${res.body.filename}`,
|
||||
},
|
||||
}
|
||||
]);
|
||||
|
||||
setLoadingStore(false);
|
||||
|
@ -207,7 +207,8 @@ export const MembershipModal = ({
|
|||
.then((values) => {
|
||||
console.log(values, "apa valuesanya");
|
||||
values.image_identity = responseFilename;
|
||||
values.image_store = responseFilenameStore;
|
||||
const data = values.image_store = JSON.stringify(responseFilenameStore);
|
||||
console.log(data,'dari modal')
|
||||
onCreate(values, responseFilename, responseFilenameStore);
|
||||
form.resetFields();
|
||||
setFileStore([]);
|
||||
|
|
|
@ -185,7 +185,7 @@ export const Payback = observer(() => {
|
|||
const dataRoute = [
|
||||
{
|
||||
route: LINKS.PAYBACK,
|
||||
name: "Konfirmasi Pembayaran"
|
||||
name: "Konfirmasi Pembayaran",
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -201,15 +201,6 @@ export const Payback = observer(() => {
|
|||
: message.success(
|
||||
response?.body?.message || `Success ${capitalize(type)} Payback`
|
||||
);
|
||||
// if (response.body.status !== 201 ) {
|
||||
// message.error(
|
||||
// response?.body?.message || `Failed ${capitalize(type)} Payback`
|
||||
// );
|
||||
// } else {
|
||||
// message.success(
|
||||
// response?.body?.message || `Success ${capitalize(type)} Payback`
|
||||
// );
|
||||
// }
|
||||
} catch (e) {
|
||||
console.error(e, "apa errornya");
|
||||
message.error(
|
||||
|
@ -521,7 +512,7 @@ export const Payback = observer(() => {
|
|||
label="Dari"
|
||||
rules={[{ required: true, message: "Please input Date!" }]}
|
||||
>
|
||||
<DatePicker style={{ width: "100%" }} />
|
||||
<DatePicker style={{ width: "100%" }}/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="end_date"
|
||||
|
@ -532,46 +523,6 @@ export const Payback = observer(() => {
|
|||
</Form.Item>
|
||||
</Form>
|
||||
</Col>
|
||||
{/* <Col span={24}> */}
|
||||
|
||||
{/* <Title level={5} type={"secondary"} strong>
|
||||
Date
|
||||
</Title>
|
||||
<RangePicker style={{ marginBottom: "20px", width: "100%" }} /> */}
|
||||
{/* <Select
|
||||
mode={"multiple"}
|
||||
placeholder="Choose Category"
|
||||
onChange={async (val) => handleFilterCategory(val)}
|
||||
style={{ marginBottom: "20px", width: "100%" }}
|
||||
value={store.product.filterCategory || []}
|
||||
>
|
||||
{store.category.data.map((item) => (
|
||||
<Option value={item.id} key={item.id}>
|
||||
{item.name}
|
||||
</Option>
|
||||
))}
|
||||
</Select> */}
|
||||
{/* </Col> */}
|
||||
{/* <Col span={24}>
|
||||
<Title level={5} type={"secondary"} strong>
|
||||
Filter Sub-Categories
|
||||
</Title>
|
||||
<Select
|
||||
mode={"multiple"}
|
||||
placeholder="Choose Sub-Category"
|
||||
onChange={(val) => {
|
||||
setFilterSubCategories(val);
|
||||
}}
|
||||
style={{ marginBottom: "20px", width: "100%" }}
|
||||
value={filterSubCategories}
|
||||
>
|
||||
{store.product.dataSubCategories.map((item) => (
|
||||
<Option value={item.id} key={item.id}>
|
||||
{item.name}
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
</Col> */}
|
||||
</Row>
|
||||
</Modal>
|
||||
</div>
|
||||
|
|
|
@ -90,12 +90,6 @@ export const PaybackCreated = observer(() => {
|
|||
key: "status",
|
||||
width: "10%",
|
||||
render: (text, record) => (
|
||||
// <Tag
|
||||
// color={PAYBACK_STATUS[text] === PAYBACK_STATUS[3] ? "cyan" : "red"}
|
||||
// style={{ color: "#4F566B" }}
|
||||
// >
|
||||
// {PAYBACK_STATUS[text]}
|
||||
// </Tag>
|
||||
<Tag
|
||||
color={
|
||||
record.status === 0
|
||||
|
@ -159,10 +153,6 @@ export const PaybackCreated = observer(() => {
|
|||
const handleSubmitFilter = async () => {
|
||||
const data = form.getFieldsValue();
|
||||
console.log(data);
|
||||
//store.payback.filterMembership = filterMembership;
|
||||
// const awal = format(parseISO(data.start_date), "dd-MM-yyyy")
|
||||
// const akhir = format(parseISO(data.start_date), "dd-MM-yyyy")
|
||||
//const awal= format(startOfDay(date.start_date()), 'yyyy-MM-dd 00:00')
|
||||
const awal = (store.payback.filterStart = moment(data.start_date).format(
|
||||
"YYYY-MM-DD 00:00:00"
|
||||
));
|
||||
|
@ -174,8 +164,6 @@ export const PaybackCreated = observer(() => {
|
|||
modalLoader.setLoading(true);
|
||||
await store.payback.getDataCreated();
|
||||
modalLoader.setLoading(false);
|
||||
// form.resetFields();
|
||||
// setFilterMembership([]);
|
||||
store.payback.visibleModalFilterCreate = false;
|
||||
};
|
||||
|
||||
|
|
|
@ -134,16 +134,6 @@ export const ProductDetail = observer(() => {
|
|||
</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
{/* <Col lg={12} xs={24}>
|
||||
<Row justify={"center"}>
|
||||
<Col lg={24} xs={12}>
|
||||
<Title strong level={3} style={styleSaldoTitle}>Saldo</Title>
|
||||
</Col>
|
||||
<Col lg={24} xs={12}>
|
||||
<Text style={styleSaldoContent}>{store.authentication.profileData?.wallet}</Text>
|
||||
</Col>
|
||||
</Row>
|
||||
</Col> */}
|
||||
</Row>
|
||||
<Row>
|
||||
<Col span={24}>
|
||||
|
@ -151,13 +141,6 @@ export const ProductDetail = observer(() => {
|
|||
<Title strong level={3}>
|
||||
Product Price History
|
||||
</Title>
|
||||
|
||||
{/* <Button style={{marginBottom: '1rem'}} onClick={() => {
|
||||
console.log('clicked filter')
|
||||
}}>
|
||||
<FilterOutlined/>
|
||||
Filter
|
||||
</Button> */}
|
||||
<Table
|
||||
columns={columns}
|
||||
dataSource={store.product.dataPriceHistory}
|
||||
|
|
|
@ -95,8 +95,6 @@ export const Profile = observer(() => {
|
|||
));
|
||||
console.log(awal);
|
||||
console.log(akhir);
|
||||
// store.transaction.filterStart = data.start_date;
|
||||
// store.transaction.filterEnd = data.end_date;
|
||||
modalLoader.setLoading(true);
|
||||
await store.transaction.getDataHistoryTransaction();
|
||||
modalLoader.setLoading(false);
|
||||
|
@ -270,83 +268,7 @@ export const Profile = observer(() => {
|
|||
{store.authentication.profileData.superior?.username}
|
||||
</Text>
|
||||
</Col>
|
||||
{/* {store.authentication.userData.role === "Retail" && (
|
||||
<Row>
|
||||
<Col span={12}>
|
||||
<Text strong>Foto Identitas</Text>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Text strong>Foto Toko</Text>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Text>
|
||||
<Image
|
||||
src={
|
||||
store.authentication.dataProfit.profileData
|
||||
?.image_identity
|
||||
? `${appConfig.apiUrl}/config/image/${store.authentication.profileData.userDetail?.image_identity}`
|
||||
: "https://st4.depositphotos.com/14953852/24787/v/600/depositphotos_247872612-stock-illustration-no-image-available-icon-vector.jpg"
|
||||
}
|
||||
style={{ width: "10vw" }}
|
||||
/>
|
||||
</Text>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Text>
|
||||
<Image
|
||||
src={
|
||||
store.authentication.dataProfit.profileData
|
||||
?.image_store
|
||||
? `${appConfig.apiUrl}/config/image/${store.authentication.profileData.userDetail?.image_store}`
|
||||
: "https://st4.depositphotos.com/14953852/24787/v/600/depositphotos_247872612-stock-illustration-no-image-available-icon-vector.jpg"
|
||||
}
|
||||
style={{ width: "10vw" }}
|
||||
/>
|
||||
</Text>
|
||||
</Col>
|
||||
</Row>
|
||||
)} */}
|
||||
{store.authentication.userData.role === "Retail" && (
|
||||
// <Row>
|
||||
// <Col span={12}>
|
||||
// <Text strong>Foto Identitas</Text>
|
||||
// </Col>
|
||||
// <Col span={12}></Col>
|
||||
// <Col span={12}>
|
||||
// <Text>
|
||||
// <Image
|
||||
// src={
|
||||
// store.authentication.profileData.userDetail
|
||||
// ?.image_identity
|
||||
// ? `${appConfig.apiUrl}/config/image/${store.authentication.profileData.userDetail?.image_identity}`
|
||||
// : "https://st4.depositphotos.com/14953852/24787/v/600/depositphotos_247872612-stock-illustration-no-image-available-icon-vector.jpg"
|
||||
// }
|
||||
// style={{ width: "10vw" }}
|
||||
// />
|
||||
// </Text>
|
||||
// </Col>
|
||||
// <Col span={24}>
|
||||
// <Text strong>Foto Toko</Text>
|
||||
// <Text>
|
||||
// <Row>
|
||||
// {JSON.parse(
|
||||
// store.authentication.profileData.userDetail
|
||||
// ?.image_store
|
||||
// ).map((item) => (
|
||||
// <Image
|
||||
// src={
|
||||
// store.authentication.profileData.userDetail
|
||||
// ?.image_store
|
||||
// ? `${appConfig.apiUrl}/config/image/${item}`
|
||||
// : "https://st4.depositphotos.com/14953852/24787/v/600/depositphotos_247872612-stock-illustration-no-image-available-icon-vector.jpg"
|
||||
// }
|
||||
// style={{ width: "10vw", marginRight: 15 }}
|
||||
// />
|
||||
// ))}
|
||||
// </Row>
|
||||
// </Text>
|
||||
// </Col>
|
||||
// </Row>
|
||||
<Row>
|
||||
<Col span={12}>
|
||||
<Text strong>Foto Identitas</Text>
|
||||
|
|
|
@ -57,10 +57,9 @@ export class Authentication {
|
|||
async getProfit(id) {
|
||||
try {
|
||||
const response = await http.get(`/auth/profile/${id}`);
|
||||
console.log(response)
|
||||
console.log(response,"Data Gambar Store")
|
||||
this.dataProfit = response.body ?? [];
|
||||
this.listImage = this.dataProfit.userDetail?.image_store ? JSON.parse(this.dataProfit.userDetail?.image_store) : [];
|
||||
|
||||
this.listImage = this.dataProfit.userDetail?.image_store ? JSON.parse(this.dataProfit.userDetail?.image_store) : [];
|
||||
this.total_data = response?.body?.count ?? 0;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
@ -70,7 +69,7 @@ export class Authentication {
|
|||
async getProfile() {
|
||||
try {
|
||||
const response = await http.get('/auth/profile');
|
||||
console.log(response)
|
||||
console.log(response,"Data Profile")
|
||||
this.profileData = response.body;
|
||||
this.imageProfil = this.profileData.userDetail?.image_store ? JSON.parse(this.profileData.userDetail?.image_store) : [];
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user