mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
refactor: update SourceDetailSheet to use useQuery with centralized cache keys
- Replace useDocumentByChunk hook with useQuery implementation - Use descriptive variable names (isDocumentByChunkFetching, documentByChunkFetchingError) - Integrate with centralized cache key management - Update all loading and error state references - Add 5-minute stale time for document queries
This commit is contained in:
parent
7f80c9c408
commit
034e42e15e
3 changed files with 24 additions and 17 deletions
|
|
@ -58,7 +58,6 @@ class BaseApiService {
|
|||
*/
|
||||
const defaultOptions: RequestOptions = {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Bearer ${this.bearerToken || ""}`,
|
||||
},
|
||||
method: "GET",
|
||||
|
|
@ -211,8 +210,11 @@ class BaseApiService {
|
|||
options?: Omit<RequestOptions, "method" | "responseType">
|
||||
) {
|
||||
return this.request(url, responseSchema, {
|
||||
...options,
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
...options,
|
||||
responseType: ResponseType.JSON,
|
||||
});
|
||||
}
|
||||
|
|
@ -224,6 +226,9 @@ class BaseApiService {
|
|||
) {
|
||||
return this.request(url, responseSchema, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
...options,
|
||||
responseType: ResponseType.JSON,
|
||||
});
|
||||
|
|
@ -236,6 +241,9 @@ class BaseApiService {
|
|||
) {
|
||||
return this.request(url, responseSchema, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
...options,
|
||||
responseType: ResponseType.JSON,
|
||||
});
|
||||
|
|
@ -248,6 +256,9 @@ class BaseApiService {
|
|||
) {
|
||||
return this.request(url, responseSchema, {
|
||||
method: "DELETE",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
...options,
|
||||
responseType: ResponseType.JSON,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue