actions API fixed
This commit is contained in:
@@ -5,11 +5,11 @@ import queryKeys from "../../services/queryKeys";
|
|||||||
|
|
||||||
export default function RecentActions() {
|
export default function RecentActions() {
|
||||||
|
|
||||||
const {data, isFetching, isError, error} = useQuery({
|
const {data:dataAction, isFetching, isError, error} = useQuery({
|
||||||
queryKey: queryKeys.recentAction,
|
queryKey: queryKeys.recentAction,
|
||||||
queryFn: async () => await recentActions()
|
queryFn: () => recentActions()
|
||||||
})
|
})
|
||||||
console.log('data', error)
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="card card-statistics h-100 mb-0">
|
<div className="card card-statistics h-100 mb-0">
|
||||||
@@ -41,7 +41,7 @@ console.log('data', error)
|
|||||||
<div className="d-xxs-flex align-items-center">
|
<div className="d-xxs-flex align-items-center">
|
||||||
<div className="total-sales">
|
<div className="total-sales">
|
||||||
<p>Last Update</p>
|
<p>Last Update</p>
|
||||||
<h1>10-10-2021 10 AM</h1>
|
<h1>{dataAction?.data?.action_data?.last_update}</h1>
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-3 mb-sm-0 ml-auto">
|
<div className="mb-3 mb-sm-0 ml-auto">
|
||||||
{/*<button className="btn btn-primary btn-xs">View All Invoices</button>*/}
|
{/*<button className="btn btn-primary btn-xs">View All Invoices</button>*/}
|
||||||
@@ -60,19 +60,19 @@ console.log('data', error)
|
|||||||
<div className="row no-gutters">
|
<div className="row no-gutters">
|
||||||
<div className="col-6 col-xxs-3 ">
|
<div className="col-6 col-xxs-3 ">
|
||||||
<p>Initial</p>
|
<p>Initial</p>
|
||||||
<h4>0</h4>
|
<h4>{dataAction?.data?.action_data?.initial}</h4>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-6 col-xxs-3 ">
|
<div className="col-6 col-xxs-3 ">
|
||||||
<p>Processing</p>
|
<p>Processing</p>
|
||||||
<h4>0</h4>
|
<h4>{dataAction?.data?.action_data?.processing}</h4>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-6 col-xxs-3 ">
|
<div className="col-6 col-xxs-3 ">
|
||||||
<p>Verifying</p>
|
<p>Verifying</p>
|
||||||
<h4>0</h4>
|
<h4>{dataAction?.data?.action_data?.verifying}</h4>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-6 col-xxs-3 ">
|
<div className="col-6 col-xxs-3 ">
|
||||||
<p>Completed</p>
|
<p>Completed</p>
|
||||||
<h4>0</h4>
|
<h4>{dataAction?.data?.action_data?.completed}</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="table-responsive m-t-20">
|
<div className="table-responsive m-t-20">
|
||||||
@@ -86,39 +86,19 @@ console.log('data', error)
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody className="text-muted">
|
<tbody className="text-muted">
|
||||||
<tr>
|
{dataAction?.data?.action_data?.actions.map((action, index) => {
|
||||||
<td>1</td>
|
let bgColor = action?.status == 'completed' ? 'badge-success-inverse' : action?.status == 'verifying' ? 'badge-info-inverse' : action?.status == 'processing' ? 'badge-warning-inverse' : 'badge-primary-inverse'
|
||||||
<td>Smith Drake</td>
|
return (
|
||||||
<td>27/3/2014</td>
|
<tr key={index}>
|
||||||
<td>
|
<td>{action?.no}</td>
|
||||||
<label className="badge mb-0 badge-primary-inverse"> Overdue</label>
|
<td>{action?.description}</td>
|
||||||
</td>
|
<td>{action?.date}</td>
|
||||||
</tr>
|
<td>
|
||||||
<tr>
|
<label className={`badge mb-0 ${bgColor}`}>{action?.status}</label>
|
||||||
<td>2</td>
|
</td>
|
||||||
<td>Martha Doe</td>
|
</tr>
|
||||||
<td>28/3/2015</td>
|
)
|
||||||
<td>
|
})}
|
||||||
<label className="badge mb-0 badge-warning-inverse"> Outstanding</label>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>3</td>
|
|
||||||
<td>Fenish Paul</td>
|
|
||||||
<td>24/3/2015</td>
|
|
||||||
<td>
|
|
||||||
<label className="badge mb-0 badge-info-inverse"> Open</label>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>4</td>
|
|
||||||
<td>Albom Mitch</td>
|
|
||||||
<td>29/3/2016</td>
|
|
||||||
<td>
|
|
||||||
<label className="badge mb-0 badge-success-inverse"> Paid</label>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user