ilk
This commit is contained in:
29
ui/src/stores/mailTestStore.js
Normal file
29
ui/src/stores/mailTestStore.js
Normal file
@@ -0,0 +1,29 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user