added some log statement in dhive calls

This commit is contained in:
Nouman Tahir 2021-02-26 13:16:46 +05:00
parent 9d6b80480b
commit 25d5de09ff

View File

@ -301,6 +301,7 @@ export const getCommunities = async (
) =>
new Promise(async (resolve, reject) => {
try {
console.log("Getting communities", query)
const data = await client.call('bridge', 'list_communities', {
last,
limit,
@ -440,6 +441,7 @@ export const ignoreUser = async (currentAccount, pin, data) => {
export const getActiveVotes = (author, permlink) =>
new Promise((resolve, reject) => {
try {
console.log("Getting active votes", author, permlink)
client
.call('condenser_api', 'get_active_votes', [author, permlink])
.then((result) => {
@ -455,6 +457,7 @@ export const getActiveVotes = (author, permlink) =>
export const getRankedPosts = async (query, currentUserName, filterNsfw) => {
try {
console.log("Getting ranked posts:", query)
let posts = await client.call('bridge', 'get_ranked_posts', query);
if (posts) {
@ -465,6 +468,7 @@ export const getRankedPosts = async (query, currentUserName, filterNsfw) => {
return updatedPosts;
}
}
console.log("Returning fetched posts: " + posts?posts.length:null)
return posts;
} catch (error) {
return error;
@ -473,6 +477,7 @@ export const getRankedPosts = async (query, currentUserName, filterNsfw) => {
export const getAccountPosts = async (query, currentUserName, filterNsfw) => {
try {
console.log("Getting account posts: ", query)
let posts = await client.call('bridge', 'get_account_posts', query);
if (posts) {
@ -483,6 +488,7 @@ export const getAccountPosts = async (query, currentUserName, filterNsfw) => {
return updatedPosts;
}
}
console.log("Returning fetched posts: " + posts?posts.length:null)
return posts;
} catch (error) {
return error;
@ -491,6 +497,7 @@ export const getAccountPosts = async (query, currentUserName, filterNsfw) => {
export const getRepliesByLastUpdate = async (query) => {
try {
console.log("Getting replies: ", query)
const replies = await client.database.call('get_replies_by_last_update', [
query.start_author,
query.start_permlink,
@ -504,7 +511,9 @@ export const getRepliesByLastUpdate = async (query) => {
};
export const getPost = async (author, permlink, currentUserName = null, isPromoted = false) => {
try {
console.log("Getting post: ", author, permlink)
const post = await client.database.call('get_content', [author, permlink]);
return post ? parsePost(post, currentUserName, isPromoted) : null;