UI: portal/header refinements, board index UX, and user settings
This commit is contained in:
@@ -79,6 +79,18 @@ export async function fetchSetting(key) {
|
||||
return data[0] || null
|
||||
}
|
||||
|
||||
export async function fetchUserSetting(key) {
|
||||
const data = await getCollection(`/user-settings?key=${encodeURIComponent(key)}&pagination=false`)
|
||||
return data[0] || null
|
||||
}
|
||||
|
||||
export async function saveUserSetting(key, value) {
|
||||
return apiFetch('/user-settings', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ key, value }),
|
||||
})
|
||||
}
|
||||
|
||||
export async function listForumsByParent(parentId) {
|
||||
return getCollection(`/forums?parent=/api/forums/${parentId}`)
|
||||
}
|
||||
@@ -134,6 +146,10 @@ export async function listThreadsByForum(forumId) {
|
||||
return getCollection(`/threads?forum=/api/forums/${forumId}`)
|
||||
}
|
||||
|
||||
export async function listThreads() {
|
||||
return getCollection('/threads')
|
||||
}
|
||||
|
||||
export async function getThread(id) {
|
||||
return apiFetch(`/threads/${id}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user