missing { data } extraction
This commit is contained in:
parent
6c4f6dcd05
commit
a39d3b1b56
23 changed files with 44 additions and 48 deletions
|
|
@ -601,7 +601,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
|||
}).then(({ data }) => data)
|
||||
},
|
||||
deleteEmojiPack({ name }) {
|
||||
return createEmojiPack({
|
||||
return deleteEmojiPack({
|
||||
name,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then(({ data }) => data)
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ export const useEmojiStore = defineStore('emoji', {
|
|||
listEmojiPacks({
|
||||
...params,
|
||||
credentials: useOAuthStore().token,
|
||||
}),
|
||||
}).then(({ data }) => data),
|
||||
)
|
||||
this.adminPacksLocalLoading = false
|
||||
},
|
||||
|
|
@ -210,10 +210,6 @@ export const useEmojiStore = defineStore('emoji', {
|
|||
pageSize: 0,
|
||||
})
|
||||
.then((data) => {
|
||||
if (data.error !== undefined) {
|
||||
return Promise.reject(data.error)
|
||||
}
|
||||
|
||||
const promises = []
|
||||
|
||||
for (let i = 0; i < Math.ceil(data.count / pageSize); i++) {
|
||||
|
|
@ -223,10 +219,6 @@ export const useEmojiStore = defineStore('emoji', {
|
|||
page: i,
|
||||
pageSize,
|
||||
}).then((pageData) => {
|
||||
if (pageData.error !== undefined) {
|
||||
return Promise.reject(pageData.error)
|
||||
}
|
||||
|
||||
return pageData.packs
|
||||
}),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -211,9 +211,10 @@ export const useInstanceStore = defineStore('instance', {
|
|||
},
|
||||
async getKnownDomains() {
|
||||
try {
|
||||
this.knownDomains = await fetchKnownDomains({
|
||||
const { data } = await fetchKnownDomains({
|
||||
credentials: window.vuex.state.users.currentUser.credentials,
|
||||
})
|
||||
this.knownDomains = data
|
||||
} catch (e) {
|
||||
console.warn("Can't load known domains\n", e)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ export const useListsStore = defineStore('lists', {
|
|||
return await createList({
|
||||
title,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((list) => {
|
||||
}).then(({ data: list }) => {
|
||||
this.setList({ listId: list.id, title })
|
||||
return list
|
||||
})
|
||||
|
|
@ -63,13 +63,15 @@ export const useListsStore = defineStore('lists', {
|
|||
return await getList({
|
||||
listId,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((list) => this.setList({ listId: list.id, title: list.title }))
|
||||
}).then(({ data: list }) =>
|
||||
this.setList({ listId: list.id, title: list.title }),
|
||||
)
|
||||
},
|
||||
async fetchListAccounts({ listId }) {
|
||||
return await getListAccounts({
|
||||
listId,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((accountIds) => {
|
||||
}).then(({ data: accountIds }) => {
|
||||
if (!this.allListsObject[listId]) {
|
||||
this.allListsObject[listId] = { accountIds: [] }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ export const useOAuthTokensStore = defineStore('oauthTokens', {
|
|||
revokeOAuthToken({
|
||||
id,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((response) => {
|
||||
if (response.status === 201) {
|
||||
}).then(({ status }) => {
|
||||
if (status === 201) {
|
||||
this.swapTokens(this.tokens.filter((token) => token.id !== id))
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ export const usePollsStore = defineStore('polls', {
|
|||
fetchPoll({
|
||||
pollId,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((poll) => {
|
||||
}).then(({ data: poll }) => {
|
||||
setTimeout(() => {
|
||||
if (this.trackedPolls[pollId]) {
|
||||
this.updateTrackedPoll(pollId)
|
||||
|
|
|
|||
|
|
@ -350,7 +350,7 @@ export const useUserHighlightStore = defineStore('user_highlight', {
|
|||
updateProfileJSON({
|
||||
params,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((user) => {
|
||||
}).then(({ data: user }) => {
|
||||
this.initUserHighlight(user)
|
||||
this.dirty = false
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue