Skip to content

Commit 6e95d64

Browse files
committed
refactor: renterd libs extract route variables
1 parent 68261fb commit 6e95d64

File tree

10 files changed

+274
-110
lines changed

10 files changed

+274
-110
lines changed

libs/react-core/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"version": "1.1.0",
55
"license": "MIT",
66
"peerDependencies": {
7-
"react": "^18.2.0",
7+
"react": "^18.2.0"
8+
},
9+
"dependencies": {
10+
"@siafoundation/next": "^0.1.3",
11+
"@siafoundation/request": "0.0.0",
812
"swr": "^2.1.1",
913
"axios": "^0.27.2",
1014
"use-local-storage-state": "^18.3.3",
11-
"@siafoundation/next": "^0.1.3",
12-
"@siafoundation/request": "0.0.0"
13-
},
14-
"dependencies": {
1515
"detect-gpu": "^5.0.34"
1616
},
1717
"types": "./src/index.d.ts"

libs/react-core/src/useDelete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import {
88
buildRouteWithParams,
99
InternalCallbackArgs,
1010
mergeInternalCallbackArgs,
11-
RequestParams,
1211
Response,
1312
InternalHookArgsCallback,
1413
mergeInternalHookArgsCallback,
1514
After,
1615
getPathFromKey,
1716
} from './request'
1817
import { useAppSettings } from './useAppSettings'
18+
import { RequestParams } from '@siafoundation/request'
1919

2020
type DeleteFunc<Params extends RequestParams, Result> = {
2121
delete: (

libs/react-core/src/useGet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
buildRouteWithParams,
99
InternalCallbackArgs,
1010
mergeInternalCallbackArgs,
11-
RequestParams,
1211
Response,
1312
mergeInternalHookArgsCallback,
1413
InternalHookArgsSwr,
@@ -18,6 +17,7 @@ import {
1817
import { SWRError } from './types'
1918
import { useAppSettings } from './useAppSettings'
2019
import { keyOrNull } from './utils'
20+
import { RequestParams } from '@siafoundation/request'
2121

2222
export function useGetSwr<Params extends RequestParams, Result>(
2323
args: InternalHookArgsSwr<Params, Result>

libs/react-core/src/usePatch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
InternalCallbackArgs,
1010
InternalHookArgsCallback,
1111
mergeInternalCallbackArgs,
12-
RequestParams,
1312
Response,
1413
mergeInternalHookArgsCallback,
1514
getPathFromKey,
@@ -22,6 +21,7 @@ import { useAppSettings } from './useAppSettings'
2221
import { useMemo } from 'react'
2322
import { keyOrNull } from './utils'
2423
import { SWRError } from './types'
24+
import { RequestParams } from '@siafoundation/request'
2525

2626
export function usePatchSwr<Params extends RequestParams, Payload, Result>(
2727
args: InternalHookArgsWithPayloadSwr<Params, Payload, Result>

libs/react-core/src/usePost.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
buildRouteWithParams,
99
InternalCallbackArgs,
1010
mergeInternalCallbackArgs,
11-
RequestParams,
1211
Response,
1312
InternalHookArgsCallback,
1413
mergeInternalHookArgsCallback,
@@ -22,6 +21,7 @@ import { SWRError } from './types'
2221
import { useAppSettings } from './useAppSettings'
2322
import { keyOrNull } from './utils'
2423
import { useWorkflows } from './workflows'
24+
import { RequestParams } from '@siafoundation/request'
2525

2626
export function usePostSwr<Params extends RequestParams, Payload, Result>(
2727
args: InternalHookArgsWithPayloadSwr<Params, Payload, Result>

libs/react-core/src/usePut.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
InternalCallbackArgs,
1010
InternalHookArgsCallback,
1111
mergeInternalCallbackArgs,
12-
RequestParams,
1312
Response,
1413
mergeInternalHookArgsCallback,
1514
getPathFromKey,
@@ -22,6 +21,7 @@ import { useAppSettings } from './useAppSettings'
2221
import { useMemo } from 'react'
2322
import { keyOrNull } from './utils'
2423
import { SWRError } from './types'
24+
import { RequestParams } from '@siafoundation/request'
2525

2626
export function usePutSwr<Params extends RequestParams, Payload, Result>(
2727
args: InternalHookArgsWithPayloadSwr<Params, Payload, Result>

0 commit comments

Comments
 (0)