diff --git a/src/api/__mocks__/users.js b/src/api/__mocks__/users.js index 07aca91e..f2e2103b 100644 --- a/src/api/__mocks__/users.js +++ b/src/api/__mocks__/users.js @@ -33,11 +33,6 @@ export async function getPasswordResetToken(nickname, authHost, token) { return Promise.resolve({ data: { token: 'g05lxnBJQnL', link: 'http://url/api/pleroma/password_reset/g05lxnBJQnL' }}) } -export async function toggleUserActivation(nickname, authHost, token) { - const response = users.find(user => user.nickname === nickname) - return Promise.resolve({ data: { ...response, deactivated: !response.deactivated }}) -} - export async function searchUsers(query, filters, authHost, token, page = 1) { const filteredUsers = filterUsers(filters) const response = filteredUsers.filter(user => user.nickname === query) @@ -48,12 +43,29 @@ export async function searchUsers(query, filters, authHost, token, page = 1) { }}) } +export async function activateUsers(nicknames, authHost, token) { + const response = nicknames.map(nickname => { + const currentUser = users.find(user => user.nickname === nickname) + return { ...currentUser, deactivated: false } + }) + return Promise.resolve({ data: response }) +} + export async function addRight(nicknames, right, authHost, token) { + console.log(nicknames) return Promise.resolve({ data: { [`is_${right}`]: true } }) } +export async function deactivateUsers(nicknames, authHost, token) { + const response = nicknames.map(nickname => { + const currentUser = users.find(user => user.nickname === nickname) + return { ...currentUser, deactivated: true } + }) + return Promise.resolve({ data: response }) +} + export async function deleteRight(nickname, right, authHost, token) { return Promise.resolve({ data: { [`is_${right}`]: false }