fix: cleanup

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei 2024-06-19 19:37:08 +08:00
parent f26caf5122
commit 5b1b1d88fc
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
2 changed files with 3 additions and 3 deletions

View File

@ -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)
}

View File

@ -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()
},