fix sss
This commit is contained in:
parent
81bb4f133b
commit
700e096dd4
2 changed files with 16 additions and 1 deletions
|
|
@ -224,6 +224,9 @@ const updateProfile = ({ credentials, params }) => {
|
||||||
formData.append(name + `[${i}][value]`, param.value)
|
formData.append(name + `[${i}][value]`, param.value)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
if (typeof params[name] === 'object') {
|
||||||
|
console.warning('Object detected in updateProfile API call. This will not work, use updateProfileJSON instead.')
|
||||||
|
}
|
||||||
formData.append(name, params[name]);
|
formData.append(name, params[name]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -237,6 +240,17 @@ const updateProfile = ({ credentials, params }) => {
|
||||||
.then((data) => parseUser(data))
|
.then((data) => parseUser(data))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const updateProfileJSON = ({ credentials, params }) => {
|
||||||
|
return promisedRequest({
|
||||||
|
url: MASTODON_PROFILE_UPDATE_URL,
|
||||||
|
credentials,
|
||||||
|
payload: params ,
|
||||||
|
method: 'PATCH'
|
||||||
|
})
|
||||||
|
.then((data) => data.json())
|
||||||
|
.then((data) => parseUser(data))
|
||||||
|
}
|
||||||
|
|
||||||
// Params needed:
|
// Params needed:
|
||||||
// nickname
|
// nickname
|
||||||
// email
|
// email
|
||||||
|
|
@ -2060,6 +2074,7 @@ const apiService = {
|
||||||
getCaptcha,
|
getCaptcha,
|
||||||
updateProfileImages,
|
updateProfileImages,
|
||||||
updateProfile,
|
updateProfile,
|
||||||
|
updateProfileJSON,
|
||||||
importMutes,
|
importMutes,
|
||||||
importBlocks,
|
importBlocks,
|
||||||
importFollows,
|
importFollows,
|
||||||
|
|
|
||||||
|
|
@ -508,7 +508,7 @@ export const useServerSideStorageStore = defineStore('serverSideStorage', {
|
||||||
this.updateCache({ username: window.vuex.state.users.currentUser.fqn })
|
this.updateCache({ username: window.vuex.state.users.currentUser.fqn })
|
||||||
const params = { pleroma_settings_store: { 'pleroma-fe': this.cache } }
|
const params = { pleroma_settings_store: { 'pleroma-fe': this.cache } }
|
||||||
window.vuex.state.api.backendInteractor
|
window.vuex.state.api.backendInteractor
|
||||||
.updateProfile({ params })
|
.updateProfileJSON({ params })
|
||||||
.then((user) => {
|
.then((user) => {
|
||||||
this.setServerSideStorage(user)
|
this.setServerSideStorage(user)
|
||||||
this.dirty = false
|
this.dirty = false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue