feat(app): add announcements, feedback, settings (stage 5)
This commit is contained in:
12
app-frontend/src/api/announcements.js
Normal file
12
app-frontend/src/api/announcements.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import { publicApi } from './http'
|
||||
|
||||
export async function fetchActiveAnnouncement() {
|
||||
const { data } = await publicApi.get('/announcements/active')
|
||||
return data
|
||||
}
|
||||
|
||||
export async function dismissAnnouncement(announcementId) {
|
||||
const { data } = await publicApi.post(`/announcements/${announcementId}/dismiss`, {})
|
||||
return data
|
||||
}
|
||||
|
||||
12
app-frontend/src/api/feedback.js
Normal file
12
app-frontend/src/api/feedback.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import { publicApi } from './http'
|
||||
|
||||
export async function submitFeedback(payload) {
|
||||
const { data } = await publicApi.post('/feedback', payload)
|
||||
return data
|
||||
}
|
||||
|
||||
export async function fetchMyFeedbacks() {
|
||||
const { data } = await publicApi.get('/feedback')
|
||||
return data
|
||||
}
|
||||
|
||||
32
app-frontend/src/api/settings.js
Normal file
32
app-frontend/src/api/settings.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import { publicApi } from './http'
|
||||
|
||||
export async function fetchUserEmail() {
|
||||
const { data } = await publicApi.get('/user/email')
|
||||
return data
|
||||
}
|
||||
|
||||
export async function bindEmail(payload) {
|
||||
const { data } = await publicApi.post('/user/bind-email', payload)
|
||||
return data
|
||||
}
|
||||
|
||||
export async function unbindEmail() {
|
||||
const { data } = await publicApi.post('/user/unbind-email', {})
|
||||
return data
|
||||
}
|
||||
|
||||
export async function fetchEmailNotify() {
|
||||
const { data } = await publicApi.get('/user/email-notify')
|
||||
return data
|
||||
}
|
||||
|
||||
export async function updateEmailNotify(payload) {
|
||||
const { data } = await publicApi.post('/user/email-notify', payload)
|
||||
return data
|
||||
}
|
||||
|
||||
export async function changePassword(payload) {
|
||||
const { data } = await publicApi.post('/user/password', payload)
|
||||
return data
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user