refactor promisedRequest to always return whole response

This commit is contained in:
Henry Jameson 2026-06-17 17:58:14 +03:00
commit 1ca0ffb1f0
25 changed files with 352 additions and 327 deletions

View file

@ -44,15 +44,16 @@ export const useAnnouncementsStore = defineStore('announcements', {
const fetchAnnouncements = async () => {
if (!isAdmin) {
return getAnnouncements({
const result = await getAnnouncements({
credentials: useOAuthStore().token,
})
return result.data
}
const all = await adminGetAnnouncements({
const { data: all } = await adminGetAnnouncements({
credentials: useOAuthStore().token,
})
const visible = await getAnnouncements({
const { data: visible } = await getAnnouncements({
credentials: useOAuthStore().token,
})
const visibleObject = visible.reduce((a, c) => {