feat(admin): migrate admin UI to Vue3
This commit is contained in:
32
admin-frontend/src/api/smtp.js
Normal file
32
admin-frontend/src/api/smtp.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import { api } from './client'
|
||||
|
||||
export async function fetchSmtpConfigs() {
|
||||
const { data } = await api.get('/smtp/configs')
|
||||
return data
|
||||
}
|
||||
|
||||
export async function createSmtpConfig(payload) {
|
||||
const { data } = await api.post('/smtp/configs', payload)
|
||||
return data
|
||||
}
|
||||
|
||||
export async function updateSmtpConfig(configId, payload) {
|
||||
const { data } = await api.put(`/smtp/configs/${configId}`, payload)
|
||||
return data
|
||||
}
|
||||
|
||||
export async function deleteSmtpConfig(configId) {
|
||||
const { data } = await api.delete(`/smtp/configs/${configId}`)
|
||||
return data
|
||||
}
|
||||
|
||||
export async function testSmtpConfig(configId, email) {
|
||||
const { data } = await api.post(`/smtp/configs/${configId}/test`, { email })
|
||||
return data
|
||||
}
|
||||
|
||||
export async function setPrimarySmtpConfig(configId) {
|
||||
const { data } = await api.post(`/smtp/configs/${configId}/primary`)
|
||||
return data
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user