Commit 976b3997 by Arjun Jhukal

replaced balance with available at withdrawl

parent 87a34838
......@@ -231,6 +231,7 @@ export default function PlayerListing() {
try {
const res = await downloadUser({
search,
status: currentTab
}).unwrap();
const blob = new Blob([res], { type: "text/csv" });
......
......@@ -195,6 +195,7 @@ export default function TransactionTable({ user_id, game_id, search, setSearch }
user: user_id?.toString(),
game: game_id?.toString(),
search,
status
}).unwrap();
const blob = new Blob([res], { type: "text/csv" });
......
......@@ -136,7 +136,7 @@ export default function WithdrawlPage({
.map((game) => {
const info =
gameInfo[game.provider.toLowerCase()] || {
balance: 0,
available: 0,
type: "sc",
};
......@@ -166,7 +166,7 @@ export default function WithdrawlPage({
{game?.name}
</strong>
<span className="text-[12px] font-[600]">
{info.balance}
{info.available}
</span>
</div>
</div>
......@@ -214,7 +214,7 @@ export default function WithdrawlPage({
onClick={() =>
handleWithdrawlChange(
game.provider,
info.balance.toString()
info.available.toString()
)
}
type="button"
......
......@@ -34,12 +34,13 @@ export const downloadApi = createApi({
baseQuery: baseQuery,
tagTypes: ["Download"],
endpoints: (builder) => ({
downloadTransaction: builder.mutation<Blob, { user?: string; game?: string; search?: string }>({
downloadTransaction: builder.mutation<Blob, { user?: string; game?: string; search?: string; status?: string }>({
async queryFn(args, _queryApi, _extraOptions, fetchWithBQ) {
const params = new URLSearchParams();
if (args.user) params.append("user", args.user.toString());
if (args.game) params.append("game", args.game.toString());
if (args.search) params.append("search", args.search.toString());
if (args.status) params.append("status", args.status.toString());
const queryString = params.toString();
const response = await fetchWithBQ({
......@@ -52,10 +53,11 @@ export const downloadApi = createApi({
return { data: response.data as Blob };
},
}),
downloadUser: builder.mutation<Blob, { search?: string }>({
downloadUser: builder.mutation<Blob, { search?: string; status?: string }>({
async queryFn(args, _queryApi, _extraOptions, fetchWithBQ) {
const params = new URLSearchParams();
if (args.search) params.append("search", args.search.toString());
if (args.status) params.append("status", args.status.toString());
const queryString = params.toString();
const response = await fetchWithBQ({
......@@ -71,4 +73,4 @@ export const downloadApi = createApi({
}),
});
export const { useDownloadTransactionMutation,useDownloadUserMutation } = downloadApi;
export const { useDownloadTransactionMutation, useDownloadUserMutation } = downloadApi;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment