refactor promisedRequest to always return whole response
This commit is contained in:
parent
c81813064b
commit
1ca0ffb1f0
25 changed files with 352 additions and 327 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue