Add private note field to user profile

This commit is contained in:
Sol Fisher Romanoff 2022-06-22 18:46:47 +03:00
parent ca8689fc88
commit 9923ff587b
No known key found for this signature in database
GPG key ID: 9D3F2B64F2341B62
5 changed files with 44 additions and 3 deletions

View file

@ -102,6 +102,11 @@ const unmuteDomain = (store, domain) => {
.then(() => store.commit('removeDomainMute', domain))
}
const setNote = (store, { id, note }) => {
return store.rootState.api.backendInteractor.setNote({ id, note })
.then((relationship) => store.commit('updateUserRelationship', [relationship]))
}
export const mutations = {
tagUser (state, { user: { id }, tag }) {
const user = state.usersObject[id]
@ -366,6 +371,9 @@ const users = {
unmuteDomains (store, domain = []) {
return Promise.all(domain.map(domain => unmuteDomain(store, domain)))
},
setNote (store, { id, note }) {
return setNote(store, { id, note })
},
fetchFriends ({ rootState, commit }, id) {
const user = rootState.users.usersObject[id]
const maxId = last(user.friendIds)