parent
f26caf5122
commit
5b1b1d88fc
|
|
@ -7,6 +7,7 @@ import { ofetch } from "ofetch"
|
|||
export abstract class RequestError extends Error {
|
||||
name = "RequestError"
|
||||
}
|
||||
const csrfToken = await getCsrfToken()
|
||||
|
||||
export const apiFetch = ofetch.create({
|
||||
baseURL: import.meta.env.VITE_API_URL,
|
||||
|
|
@ -14,8 +15,6 @@ export const apiFetch = ofetch.create({
|
|||
retry: false,
|
||||
onRequest: async ({ options }) => {
|
||||
if (options.method && options.method.toLowerCase() !== "get") {
|
||||
const csrfToken = await getCsrfToken()
|
||||
|
||||
if (typeof options.body === "string") {
|
||||
options.body = JSON.parse(options.body)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import { entryActions } from "../entry/store"
|
||||
import { feedActions } from "../feed"
|
||||
import { subscriptionActions } from "../subscription"
|
||||
import { uiActions } from "../ui"
|
||||
import { unreadActions } from "../unread"
|
||||
|
||||
export const clearLocalPersistStoreData = () => {
|
||||
// All clear and reset method will aggregate here
|
||||
[entryActions, subscriptionActions, unreadActions, uiActions].forEach(
|
||||
[entryActions, subscriptionActions, unreadActions, uiActions, feedActions].forEach(
|
||||
(actions) => {
|
||||
actions.clear()
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue