diff --git a/src/App.vue b/src/App.vue index d297b13..1895828 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,7 +3,11 @@ + + + + diff --git a/src/api/groups.ts b/src/api/groups.ts index a122f39..dcbac8f 100644 --- a/src/api/groups.ts +++ b/src/api/groups.ts @@ -71,7 +71,7 @@ export default { }, deleteMany: async (IDs: number[]): Promise<[AxiosResponse?, string?]> => { try { - const data = await $axios.delete(`v1/groups`, { + const data = await $axios.delete('v1/groups', { data: { array: IDs, }, diff --git a/src/api/users.ts b/src/api/users.ts index b5b4e88..e6a1d8d 100644 --- a/src/api/users.ts +++ b/src/api/users.ts @@ -3,6 +3,7 @@ import { AxiosResponse } from 'axios'; import { OrderBy } from '@/types/order-by'; import { camelToSnake } from '@/mixins/case-converter'; import { setURIParams } from '@/mixins/query-params'; +import { NewCredentials } from '@/types/new-credentials'; export default { getAll: async ( @@ -73,7 +74,7 @@ export default { }, deleteMany: async (IDs: number[]): Promise<[AxiosResponse?, string?]> => { try { - const data = await $axios.delete(`v1/users`, { + const data = await $axios.delete('v1/users', { data: { array: IDs, }, @@ -85,7 +86,7 @@ export default { }, blockMany: async (IDs: number[]): Promise<[AxiosResponse?, string?]> => { try { - const data = await $axios.patch(`v1/users/block`, { + const data = await $axios.patch('v1/users/block', { array: IDs, }); return [data, undefined]; @@ -95,7 +96,7 @@ export default { }, unblockMany: async (IDs: number[]): Promise<[AxiosResponse?, string?]> => { try { - const data = await $axios.patch(`v1/users/unblock`, { + const data = await $axios.patch('v1/users/unblock', { array: IDs, }); return [data, undefined]; @@ -103,4 +104,14 @@ export default { return [undefined, e?.response?.data?.error ?? e.message]; } }, + resetPassword: async ( + ID: number, + ): Promise<[AxiosResponse?, string?]> => { + try { + const data = await $axios.patch(`v1/users/password/${ID}`); + return [data, undefined]; + } catch (e: any) { + return [undefined, e?.response?.data?.error ?? e.message]; + } + }, }; diff --git a/src/components/InfoModal.vue b/src/components/InfoModal.vue index 0935692..9e4bd8d 100644 --- a/src/components/InfoModal.vue +++ b/src/components/InfoModal.vue @@ -1,23 +1,23 @@