refactor: Remove dedundant httpError assignment
This commit is contained in:
@@ -24,15 +24,8 @@ export default async function paginateAll(
|
|||||||
url: links.next.uri,
|
url: links.next.uri,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (nextPageResponse.httpError) {
|
aggregatedResponse.data.push(...nextPageResponse.data);
|
||||||
aggregatedResponse.error = nextPageResponse.httpError;
|
links = parseLinkHeader(nextPageResponse.headers.link);
|
||||||
|
|
||||||
links = null;
|
|
||||||
} else {
|
|
||||||
aggregatedResponse.data.push(...nextPageResponse.data);
|
|
||||||
|
|
||||||
links = parseLinkHeader(nextPageResponse.headers.link);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return aggregatedResponse;
|
return aggregatedResponse;
|
||||||
|
@@ -15,14 +15,8 @@ export default {
|
|||||||
|
|
||||||
const response = await $.http.get('/conversations.list');
|
const response = await $.http.get('/conversations.list');
|
||||||
|
|
||||||
if (response.httpError) {
|
|
||||||
channels.error = response.httpError;
|
|
||||||
return channels;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (response.data.ok === false) {
|
if (response.data.ok === false) {
|
||||||
channels.error = response.data;
|
throw new Error(response.data);
|
||||||
return channels;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
channels.data = response.data.channels.map((channel: IJSONObject) => {
|
channels.data = response.data.channels.map((channel: IJSONObject) => {
|
||||||
|
@@ -33,14 +33,8 @@ const getUserFollowers = async (
|
|||||||
|
|
||||||
response = await $.http.get(requestPath);
|
response = await $.http.get(requestPath);
|
||||||
|
|
||||||
if (response.httpError) {
|
|
||||||
followers.error = response.httpError;
|
|
||||||
return followers;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (response.data?.errors) {
|
if (response.data?.errors) {
|
||||||
followers.error = response.data.errors;
|
throw new Error(response.data.errors);
|
||||||
return followers;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response.data.meta.result_count > 0) {
|
if (response.data.meta.result_count > 0) {
|
||||||
|
Reference in New Issue
Block a user