missing { data } extraction

This commit is contained in:
Henry Jameson 2026-06-22 19:44:44 +03:00
commit a39d3b1b56
23 changed files with 44 additions and 48 deletions

View file

@ -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)

View file

@ -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
}),
)

View file

@ -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)
}

View file

@ -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: [] }
}

View file

@ -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))
}
})

View file

@ -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)

View file

@ -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
})