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
|
|
@ -31,10 +31,7 @@ export const useBookmarkFoldersStore = defineStore('bookmarkFolders', {
|
|||
this.fetcher = fetchBookmarkFolders({
|
||||
credentials: useOAuthStore().token,
|
||||
})
|
||||
.then(
|
||||
(folders) => this.setBookmarkFolders(folders),
|
||||
(rej) => console.error(rej),
|
||||
)
|
||||
.then(({ data: folders }) => this.setBookmarkFolders(folders))
|
||||
.catch((e) => {
|
||||
console.error(e)
|
||||
})
|
||||
|
|
@ -61,7 +58,7 @@ export const useBookmarkFoldersStore = defineStore('bookmarkFolders', {
|
|||
name,
|
||||
emoji,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((folder) => {
|
||||
}).then(({ data: folder }) => {
|
||||
this.setBookmarkFolder(folder)
|
||||
return folder
|
||||
})
|
||||
|
|
@ -72,7 +69,7 @@ export const useBookmarkFoldersStore = defineStore('bookmarkFolders', {
|
|||
folderId,
|
||||
name,
|
||||
emoji,
|
||||
}).then((folder) => {
|
||||
}).then(({ data: folder }) => {
|
||||
this.setBookmarkFolder(folder)
|
||||
return folder
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue