missing { data } extraction
This commit is contained in:
parent
6c4f6dcd05
commit
a39d3b1b56
23 changed files with 44 additions and 48 deletions
|
|
@ -27,7 +27,7 @@ const BookmarkFolderEdit = {
|
|||
|
||||
fetchBookmarkFolders({
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((folders) => {
|
||||
}).then(({ data: folders }) => {
|
||||
const folder = folders.find((folder) => folder.id === this.id)
|
||||
if (!folder) return
|
||||
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ const Chat = {
|
|||
maxId,
|
||||
sinceId,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((messages) => {
|
||||
}).then(({ data: messages }) => {
|
||||
// Clear the current chat in case we're recovering from a ws connection loss.
|
||||
if (isFirstFetch) {
|
||||
chatService.clear(chatMessageService)
|
||||
|
|
@ -310,10 +310,11 @@ const Chat = {
|
|||
let chat = this.findOpenedChatByRecipientId(this.recipientId)
|
||||
if (!chat) {
|
||||
try {
|
||||
chat = await getOrCreateChat({
|
||||
const { data } = await getOrCreateChat({
|
||||
accountId: this.recipientId,
|
||||
credentials: useOAuthStore().token,
|
||||
})
|
||||
chat = data
|
||||
} catch (e) {
|
||||
console.error('Error creating or getting a chat', e)
|
||||
this.errorLoadingChat = true
|
||||
|
|
@ -383,7 +384,7 @@ const Chat = {
|
|||
params,
|
||||
credentials: useOAuthStore().token,
|
||||
})
|
||||
.then((data) => {
|
||||
.then(({ data }) => {
|
||||
this.$store.dispatch('addChatMessages', {
|
||||
chatId: this.currentChat.id,
|
||||
updateMaxId: false,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ const RemoteUserResolver = {
|
|||
id,
|
||||
credentials: useOAuthStore().token,
|
||||
})
|
||||
.then((externalUser) => {
|
||||
.then(({ data: externalUser }) => {
|
||||
if (externalUser.error) {
|
||||
this.error = true
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -490,7 +490,7 @@ const AppearanceTab = {
|
|||
background,
|
||||
credentials: useOAuthStore().token,
|
||||
})
|
||||
.then((data) => {
|
||||
.then(({ data }) => {
|
||||
this.$store.commit('addNewUsers', [data])
|
||||
this.$store.commit('setCurrentUser', data)
|
||||
this.backgroundPreview = null
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ const ComposingTab = {
|
|||
updateProfile({
|
||||
params,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((user) => {
|
||||
}).then(({ data: user }) => {
|
||||
this.$store.commit('addNewUsers', [user])
|
||||
this.$store.commit('setCurrentUser', user)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ const DataImportExportTab = {
|
|||
return importFollows({
|
||||
file,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((status) => {
|
||||
}).then(({ data: status }) => {
|
||||
if (!status) {
|
||||
throw new Error('failed')
|
||||
}
|
||||
|
|
@ -74,7 +74,7 @@ const DataImportExportTab = {
|
|||
return importBlocks({
|
||||
file,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((status) => {
|
||||
}).then(({ data: status }) => {
|
||||
if (!status) {
|
||||
throw new Error('failed')
|
||||
}
|
||||
|
|
@ -84,13 +84,13 @@ const DataImportExportTab = {
|
|||
return importMutes({
|
||||
file,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((status) => {
|
||||
}).then(({ data: status }) => {
|
||||
if (!status) {
|
||||
throw new Error('failed')
|
||||
}
|
||||
})
|
||||
},
|
||||
generateExportableUsersContent(users) {
|
||||
generateExportableUsersContent({ data: users }) {
|
||||
// Get addresses
|
||||
return users
|
||||
.map((user) => {
|
||||
|
|
@ -121,7 +121,7 @@ const DataImportExportTab = {
|
|||
listBackups({
|
||||
credentials: useOAuthStore().token,
|
||||
})
|
||||
.then((res) => {
|
||||
.then(({ data: res }) => {
|
||||
this.backups = res
|
||||
this.listBackupsError = false
|
||||
})
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ const GeneralTab = {
|
|||
updateProfile({
|
||||
params,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((user) => {
|
||||
}).then(({ data: user }) => {
|
||||
this.$store.commit('addNewUsers', [user])
|
||||
this.$store.commit('setCurrentUser', user)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ const MutesAndBlocks = {
|
|||
return importFollows({
|
||||
file,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((status) => {
|
||||
}).then(({ data: status }) => {
|
||||
if (!status) {
|
||||
throw new Error('failed')
|
||||
}
|
||||
|
|
@ -70,7 +70,7 @@ const MutesAndBlocks = {
|
|||
return importBlocks({
|
||||
file,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((status) => {
|
||||
}).then(({ data: status }) => {
|
||||
if (!status) {
|
||||
throw new Error('failed')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ const ProfileTab = {
|
|||
params,
|
||||
credentials: useOAuthStore().token,
|
||||
})
|
||||
.then((user) => {
|
||||
.then(({ data: user }) => {
|
||||
this.$store.commit('addNewUsers', [user])
|
||||
this.$store.commit('setCurrentUser', user)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ export default {
|
|||
mfaDisableOTP({
|
||||
password: this.currentPassword,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((res) => {
|
||||
}).then(({ data: res }) => {
|
||||
this.inProgress = false
|
||||
if (res.error) {
|
||||
this.error = res.error
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ const SecurityTab = {
|
|||
deleteAccount({
|
||||
credentials: useOAuthStore().token,
|
||||
password: this.deleteAccountConfirmPasswordInput,
|
||||
}).then((res) => {
|
||||
}).then(({ data: res }) => {
|
||||
if (res.status === 'success') {
|
||||
this.$store.dispatch('logout')
|
||||
this.$router.push({ name: 'root' })
|
||||
|
|
@ -94,7 +94,7 @@ const SecurityTab = {
|
|||
newPasswordConfirmation: this.changePasswordInputs[2],
|
||||
credentials: useOAuthStore().token,
|
||||
}
|
||||
changePassword(params).then((res) => {
|
||||
changePassword(params).then(({ data: res }) => {
|
||||
if (res.status === 'success') {
|
||||
this.changedPassword = true
|
||||
this.changePasswordError = false
|
||||
|
|
@ -111,7 +111,7 @@ const SecurityTab = {
|
|||
password: this.changeEmailPassword,
|
||||
credentials: useOAuthStore().token,
|
||||
}
|
||||
changeEmail(params).then((res) => {
|
||||
changeEmail(params).then(({ data: res }) => {
|
||||
if (res.status === 'success') {
|
||||
this.changedEmail = true
|
||||
this.changeEmailError = false
|
||||
|
|
@ -127,7 +127,7 @@ const SecurityTab = {
|
|||
password: this.moveAccountPassword,
|
||||
credentials: useOAuthStore().token,
|
||||
}
|
||||
moveAccount(params).then((res) => {
|
||||
moveAccount(params).then(({ data: res }) => {
|
||||
if (res.status === 'success') {
|
||||
this.movedAccount = true
|
||||
this.moveAccountError = false
|
||||
|
|
@ -163,7 +163,7 @@ const SecurityTab = {
|
|||
listAliases({
|
||||
credentials: useOAuthStore().token,
|
||||
})
|
||||
.then((res) => {
|
||||
.then(({ data: res }) => {
|
||||
this.aliases = res.aliases
|
||||
this.listAliasesError = false
|
||||
})
|
||||
|
|
|
|||
|
|
@ -600,7 +600,7 @@ export default {
|
|||
}
|
||||
|
||||
updateProfile({ params })
|
||||
.then((user) => {
|
||||
.then(({ data: user }) => {
|
||||
this.newFields.splice(this.newFields.length)
|
||||
merge(this.newFields, user.fields)
|
||||
this.$store.commit('addNewUsers', [user])
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ const WhoToFollow = {
|
|||
fetchUser({
|
||||
id,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((externalUser) => {
|
||||
}).then(({ data: externalUser }) => {
|
||||
if (!externalUser.error) {
|
||||
this.$store.commit('addNewUsers', [externalUser])
|
||||
this.users.push(externalUser)
|
||||
|
|
@ -34,7 +34,7 @@ const WhoToFollow = {
|
|||
getWhoToFollow() {
|
||||
const credentials = useOAuthStore().token
|
||||
if (credentials) {
|
||||
suggestions({ credentials }).then((reply) => {
|
||||
suggestions({ credentials }).then(({ data: reply }) => {
|
||||
this.showWhoToFollow(reply)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ function showWhoToFollow(panel, reply) {
|
|||
fetchUser({
|
||||
id: name,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((externalUser) => {
|
||||
}).then(({ data: externalUser }) => {
|
||||
if (!externalUser.error) {
|
||||
panel.$store.commit('addNewUsers', [externalUser])
|
||||
toFollow.id = externalUser.id
|
||||
|
|
@ -36,7 +36,7 @@ function getWhoToFollow(panel) {
|
|||
panel.usersToFollow.forEach((toFollow) => {
|
||||
toFollow.name = 'Loading...'
|
||||
})
|
||||
suggestions({ credentials }).then((reply) => {
|
||||
suggestions({ credentials }).then(({ data: reply }) => {
|
||||
showWhoToFollow(panel, reply)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue