Skip to content

Commit d1a49ce

Browse files
feat: allow partial update in backend (#801)
1 parent b45efec commit d1a49ce

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/backend/app/routes/http/admin/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from sqlmodel import select
55

66
from app.deps import CurrentUser, SessionDep
7-
from app.models.config import Config, ConfigIn
7+
from app.models.config import Config, ConfigUpdate
88

99
router = APIRouter()
1010

@@ -13,7 +13,7 @@
1313
async def change_config(
1414
_: CurrentUser, # Only check for login here
1515
session: SessionDep,
16-
config_in: ConfigIn,
16+
config_in: ConfigUpdate,
1717
):
1818
config_object = select(Config)
1919
result = await session.exec(config_object)

src/frontend/src/lib/queries/config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ export const prefetch = async ({ queryClient, fetch }: { queryClient: any; fetch
2222
});
2323
};
2424

25-
type ConfigIn = {
25+
type ConfigUpdate = {
2626
// Storage constraints
27-
total_storage_limit_gb?: number;
28-
max_file_size_mb?: number;
27+
total_storage_limit?: number;
28+
max_file_size_limit?: number;
2929

3030
// Default constraints
3131
default_expiry?: number;
@@ -56,7 +56,7 @@ export const useConfigQuery = () => {
5656
retry: true
5757
}));
5858

59-
const update_config = async (data: Partial<ConfigIn>) => {
59+
const update_config = async (data: Partial<ConfigUpdate>) => {
6060
const res = await fetch(Api.ADMIN.CONFIG, {
6161
method: 'PATCH',
6262
headers: {

0 commit comments

Comments
 (0)