refactor promisedRequest to always return whole response

This commit is contained in:
Henry Jameson 2026-06-17 17:58:14 +03:00
commit 1ca0ffb1f0
25 changed files with 352 additions and 327 deletions

View file

@ -1,6 +1,7 @@
import { parseChat } from 'src/services/entity_normalizer/entity_normalizer.service.js'
import { paramsString, promisedRequest } from './helpers.js'
import { parseChat } from 'src/services/entity_normalizer/entity_normalizer.service.js'
const PLEROMA_CHATS_URL = '/api/v1/pleroma/chats'
const PLEROMA_CHAT_URL = (id) => `/api/v1/pleroma/chats/by-account-id/${id}`
const PLEROMA_CHAT_MESSAGES_URL = (id, { maxId, sinceId, limit }) =>
@ -13,7 +14,7 @@ export const chats = ({ credentials }) =>
promisedRequest({
url: PLEROMA_CHATS_URL,
credentials,
}).then((data) => ({
}).then(({ data }) => ({
chatList: data.map(parseChat).filter((c) => c),
}))