Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
denser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
denser
Merge requests
!556
Couldn't fetch the linked file.
display redeem rewards only for logged in user
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
display redeem rewards only for logged in user
redeem-rewards-display
into
main
Overview
0
Commits
1
Pipelines
3
Changes
1
Merged
Piotr Berezka
requested to merge
redeem-rewards-display
into
main
1 month ago
Overview
0
Commits
1
Pipelines
3
Changes
13
Expand
0
0
Merge request reports
Compare
version 1
version 2
a7eff42e
1 month ago
version 1
47354fe2
1 month ago
main (base)
and
version 2
latest version
a60ae97f
1 commit,
1 month ago
version 2
a7eff42e
1 commit,
1 month ago
version 1
47354fe2
1 commit,
1 month ago
Show latest version
13 files
+
162
−
9
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
13
Search (e.g. *.vue) (Ctrl+P)
apps/wallet/components/hooks/use-cancel-transfer-from-savings-mutation.ts
0 → 100644
+
31
−
0
Options
import
{
useUser
}
from
'
@smart-signer/lib/auth/use-user
'
;
import
{
useMutation
,
useQueryClient
}
from
'
@tanstack/react-query
'
;
import
{
transactionService
}
from
'
@transaction/index
'
;
import
{
logger
}
from
'
@ui/lib/logger
'
;
export
function
useCancelTransferFromSavingsMutation
()
{
const
queryClient
=
useQueryClient
();
const
{
user
}
=
useUser
();
const
cancelTransferFromSavingsMutation
=
useMutation
({
mutationFn
:
async
(
params
:
{
fromAccount
:
string
;
requestId
:
number
})
=>
{
const
broadcastResult
=
await
transactionService
.
cancelTransferFromSavings
(
params
.
fromAccount
,
params
.
requestId
,
{
observe
:
true
}
);
const
response
=
{
...
params
,
broadcastResult
};
logger
.
info
(
'
Done cancel transfer from savings transaction: %o
'
,
response
);
},
onSuccess
:
(
data
)
=>
{
logger
.
info
(
'
useCancelTransferFromSavingsMutation onSuccess data: %o
'
,
data
);
const
{
username
}
=
user
;
queryClient
.
invalidateQueries
({
queryKey
:
[
'
savingsWithdrawalsFrom
'
,
username
]
});
}
});
return
cancelTransferFromSavingsMutation
;
}
Loading