Skip to content

Commit 3ac4cf5

Browse files
authored
chore(web): switch admin settings calls to v2 (#1679)
1 parent 4da81c8 commit 3ac4cf5

5 files changed

Lines changed: 10 additions & 11 deletions

File tree

tests/unit_test/test_v1_ghost_guard.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
88
Phase 8 task #44 (H3) cleaned the provider-aware Hurl suite to use
99
``/api/v2/providers/*`` so it no longer hits dead v1 provider CRUD routes.
10-
A few other domains (apikeys, audit, marketplace, settings, prompts, chat
11-
ops, export, document upload variants) still legitimately live at
10+
A few other domains (apikeys, audit, marketplace, prompts, chat ops, export,
11+
document upload variants) still legitimately live at
1212
``/api/v1`` until tasks #50–#52 / #47–#49 land. Those paths are listed
1313
in ``TRANSITIONAL_V1_PREFIXES`` below and each follow-up PR is expected
1414
to shrink the set as it migrates the corresponding domain to ``/api/v2``.
@@ -36,7 +36,7 @@
3636
# Transitional prefixes — these v1 routes are still mounted in main and used
3737
# by e2e Hurl as long as the corresponding G* migration tasks have not landed.
3838
# Each follow-up PR (G4a audit / G4b apikeys / G4c marketplace / G3 prompts /
39-
# G1 export / G2 settings / G4d chat ops) is expected to remove the matching
39+
# G1 export / G4d chat ops) is expected to remove the matching
4040
# entry from this set together with its Hurl rewrite.
4141
#
4242
# Anything outside both sets is an unrecognised v1 reference and must be
@@ -47,7 +47,6 @@
4747
"/api/v1/audit-logs", # G4a → /api/v2/audit-logs
4848
"/api/v1/marketplace", # G4c → /api/v2/marketplace
4949
"/api/v1/prompts", # G3 → /api/v2/prompts
50-
"/api/v1/settings", # G2 → /api/v2/settings
5150
"/api/v1/collections", # G1 (export) + G5 (document upload variants)
5251
"/api/v1/export-tasks", # G1 → /api/v2/export-tasks
5352
"/api/v1/chats", # G4d → /api/v2/chats

web/src/api-v2/schema.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ export interface paths {
863863
patch?: never;
864864
trace?: never;
865865
};
866-
"/api/v1/settings": {
866+
"/api/v2/settings": {
867867
parameters: {
868868
query?: never;
869869
header?: never;
@@ -881,7 +881,7 @@ export interface paths {
881881
patch?: never;
882882
trace?: never;
883883
};
884-
"/api/v1/settings/parser_health": {
884+
"/api/v2/settings/parser_health": {
885885
parameters: {
886886
query?: never;
887887
header?: never;
@@ -898,7 +898,7 @@ export interface paths {
898898
patch?: never;
899899
trace?: never;
900900
};
901-
"/api/v1/settings/test_mineru_token": {
901+
"/api/v2/settings/test_mineru_token": {
902902
parameters: {
903903
query?: never;
904904
header?: never;

web/src/app/admin/configuration/parser-settings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export const ParserSettings = ({
105105
setHealthLoading(true);
106106
try {
107107
const response = await fetch(
108-
`${process.env.NEXT_PUBLIC_BASE_PATH || ''}/api/v1/settings/parser_health`,
108+
`${process.env.NEXT_PUBLIC_BASE_PATH || ''}/api/v2/settings/parser_health`,
109109
{
110110
credentials: 'include',
111111
cache: 'no-store',

web/src/features/admin/client-api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import type {
1919
// kept separate per design-lock msg=5f0a370b decision 2e.
2020

2121
export async function updateSettings(input: Settings): Promise<Settings> {
22-
const { data } = await browserApiClient.PUT('/api/v1/settings', {
22+
const { data } = await browserApiClient.PUT('/api/v2/settings', {
2323
body: input,
2424
});
2525
if (!data) {
@@ -37,7 +37,7 @@ export async function testMineruToken(
3737
token: string,
3838
): Promise<MineruTokenTestResponse> {
3939
const { data } = await browserApiClient.POST(
40-
'/api/v1/settings/test_mineru_token',
40+
'/api/v2/settings/test_mineru_token',
4141
{
4242
body: { token },
4343
},

web/src/features/admin/server-api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type { Settings, SystemDefaultQuotasResponse } from './types';
99

1010
export async function getSettings(): Promise<Settings | null> {
1111
const client = await createServerApiClient();
12-
const { data } = await client.GET('/api/v1/settings', {});
12+
const { data } = await client.GET('/api/v2/settings', {});
1313
return data ?? null;
1414
}
1515

0 commit comments

Comments
 (0)