Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Block Explorer UI
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
Block Explorer UI
Commits
2f9d35ac
Commit
2f9d35ac
authored
3 months ago
by
Lukas
Browse files
Options
Downloads
Patches
Plain Diff
Update usePostContentReplies hook
parent
3e4cfa37
No related branches found
No related tags found
1 merge request
!510
Lbudginas/#411 add post comments
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hooks/api/postPage/usePostContentReplies.tsx
+12
-2
12 additions, 2 deletions
hooks/api/postPage/usePostContentReplies.tsx
with
12 additions
and
2 deletions
hooks/api/postPage/usePostContentReplies.tsx
+
12
−
2
View file @
2f9d35ac
import
{
useQuery
}
from
"
@tanstack/react-query
"
;
import
fetchingService
from
"
@/services/FetchingService
"
;
import
Hive
from
"
@/types/Hive
"
;
const
usePostContentReplies
=
(
accountName
:
string
,
permlink
:
string
)
=>
{
const
usePostContentReplies
=
(
accountName
:
string
,
permlink
:
string
,
...
queryProps
:
any
)
=>
{
const
trimAccount
=
accountName
.
replace
(
"
@
"
,
""
);
const
{
data
,
isLoading
,
isError
}
=
useQuery
({
queryKey
:
[
"
post content replies
"
,
trimAccount
,
permlink
],
queryFn
:
()
=>
fetchPostContentReplies
(
trimAccount
,
permlink
),
refetchOnWindowFocus
:
false
,
...
queryProps
,
});
const
fetchPostContentReplies
=
async
(
...
...
@@ -23,7 +29,11 @@ const usePostContentReplies = (accountName: string, permlink: string) => {
return
response
;
};
return
{
data
,
isLoading
,
isError
};
return
{
data
,
isLoading
,
isError
}
as
{
data
:
Hive
.
Content
[];
isLoading
:
boolean
;
isError
:
boolean
;
};
};
export
default
usePostContentReplies
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment