From 536dcb1e95c8c0b7d2aa7d137e246de77598f42b Mon Sep 17 00:00:00 2001 From: Bubka <858858+Bubka@users.noreply.github.com> Date: Thu, 19 Oct 2023 11:45:21 +0200 Subject: [PATCH] Set up TwoFAccounts api service --- .../js_vue3/services/twofaccountService.js | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 resources/js_vue3/services/twofaccountService.js diff --git a/resources/js_vue3/services/twofaccountService.js b/resources/js_vue3/services/twofaccountService.js new file mode 100644 index 00000000..3c04904c --- /dev/null +++ b/resources/js_vue3/services/twofaccountService.js @@ -0,0 +1,42 @@ +import { httpClientFactory } from '@/services/httpClientFactory' + +const apiClient = httpClientFactory('api') + +export default { + /** + * + * @returns + */ + getAll() { + return apiClient.get('/twofaccounts') + }, + + get(id, config = {}) { + return apiClient.get('/twofaccounts/' + id, { ...config }) + }, + + preview(uri, config = {}) { + return apiClient.post('/twofaccounts/preview', { uri: uri }, { ...config }) + }, + + getLogo(service, config = {}) { + return apiClient.post('/icons/default', { service: service }, { ...config }) + }, + + deleteIcon(icon, config = {}) { + return apiClient.delete('/icons/' + icon, { ...config }) + }, + + getOtpById(id, config = {}) { + return apiClient.get('/twofaccounts/' + id + '/otp', { ...config }) + }, + + getOtpByUri(uri, config = {}) { + return apiClient.post('/twofaccounts/otp', { uri: uri }, { ...config }) + }, + + getOtpByParams(params, config = {}) { + return apiClient.post('/twofaccounts/otp', params, { ...config }) + }, + +} \ No newline at end of file