Files
bssapp/ui/src/stores/mailTestStore.js
2026-02-11 17:46:22 +03:00

30 lines
545 B
JavaScript

import { defineStore } from 'pinia'
import { post } from 'src/services/api'
export const useMailTestStore = defineStore('mailTest', {
state: () => ({
loading: false,
lastResult: null
}),
actions: {
async sendTestMail (to) {
this.loading = true
try {
const data = await post('/test-mail', {
to
})
this.lastResult = data
return true
} catch (err) {
this.lastResult = err
throw err
} finally {
this.loading = false
}
}
}
})