refactor promisedRequest to always return whole response
This commit is contained in:
parent
c81813064b
commit
1ca0ffb1f0
25 changed files with 352 additions and 327 deletions
|
|
@ -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),
|
||||
}))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue