Skip to content

Commit

Permalink
fix: illegal path (#1186)
Browse files Browse the repository at this point in the history
  • Loading branch information
tea-artist authored Dec 22, 2024
1 parent ee57831 commit 163b04a
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/openapi/src/dashboard/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { registerRoute, urlBuilder } from '../utils';
import { z } from '../zod';
import { dashboardLayoutSchema, dashboardPluginItemSchema } from './types';

export const GET_DASHBOARD = 'base/{baseId}/dashboard/{id}';
export const GET_DASHBOARD = '/base/{baseId}/dashboard/{id}';

export const getDashboardVoSchema = z.object({
id: z.string(),
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi/src/dashboard/plugin-get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { z } from '../zod';
import { pluginInstallStorageSchema } from './types';

export const GET_DASHBOARD_INSTALL_PLUGIN =
'base/{baseId}/dashboard/{dashboardId}/plugin/{installPluginId}';
'/base/{baseId}/dashboard/{dashboardId}/plugin/{installPluginId}';

export const getDashboardInstallPluginVoSchema = z.object({
pluginId: z.string(),
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi/src/dashboard/plugin-install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { axios } from '../axios';
import { registerRoute, urlBuilder } from '../utils';
import { z } from '../zod';

export const DASHBOARD_INSTALL_PLUGIN = 'base/{baseId}/dashboard/{id}/plugin';
export const DASHBOARD_INSTALL_PLUGIN = '/base/{baseId}/dashboard/{id}/plugin';

export const dashboardInstallPluginRoSchema = z.object({
name: z.string(),
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi/src/dashboard/plugin-remove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { registerRoute, urlBuilder } from '../utils';
import { z } from '../zod';

export const DASHBOARD_REMOVE_PLUGIN =
'base/{baseId}/dashboard/{dashboardId}/plugin/{pluginInstallId}';
'/base/{baseId}/dashboard/{dashboardId}/plugin/{pluginInstallId}';

export const DashboardRemovePluginRoute: RouteConfig = registerRoute({
method: 'delete',
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi/src/dashboard/plugin-rename.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { registerRoute, urlBuilder } from '../utils';
import { z } from '../zod';

export const DASHBOARD_PLUGIN_RENAME =
'base/{baseId}/dashboard/{dashboardId}/plugin/{pluginInstallId}/rename';
'/base/{baseId}/dashboard/{dashboardId}/plugin/{pluginInstallId}/rename';

export const dashboardPluginRenameRoSchema = z.object({
name: z.string(),
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi/src/dashboard/plugin-update-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { IPluginInstallStorage } from './types';
import { pluginInstallStorageSchema } from './types';

export const DASHBOARD_PLUGIN_UPDATE_STORAGE =
'base/{baseId}/dashboard/{dashboardId}/plugin/{pluginInstallId}/update-storage';
'/base/{baseId}/dashboard/{dashboardId}/plugin/{pluginInstallId}/update-storage';

export const dashboardPluginUpdateStorageRoSchema = z.object({
storage: pluginInstallStorageSchema.optional(),
Expand Down
3 changes: 1 addition & 2 deletions packages/openapi/src/generate.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ function registerAllRoute() {
type: 'http',
scheme: 'bearer',
});
const path = routeObj.path.startsWith('/') ? routeObj.path : `/${routeObj.path}`;
registry.registerPath({ ...routeObj, path, security: [{ [bearerAuth.name]: [] }] });
registry.registerPath({ ...routeObj, security: [{ [bearerAuth.name]: [] }] });
}
return registry;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi/src/view/plugin-get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { pluginInstallStorageSchema } from '../dashboard';
import { registerRoute, urlBuilder } from '../utils';
import { z } from '../zod';

export const GET_VIEW_INSTALL_PLUGIN = 'table/{tableId}/view/{viewId}/plugin';
export const GET_VIEW_INSTALL_PLUGIN = '/table/{tableId}/view/{viewId}/plugin';

export const getViewInstallPluginVoSchema = z.object({
pluginId: z.string(),
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi/src/view/plugin-install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { axios } from '../axios';
import { registerRoute, urlBuilder } from '../utils';
import { z } from '../zod';

export const VIEW_INSTALL_PLUGIN = 'table/{tableId}/view/plugin';
export const VIEW_INSTALL_PLUGIN = '/table/{tableId}/view/plugin';

export const viewInstallPluginRoSchema = z.object({
name: z.string().optional(),
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi/src/view/plugin-update-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { pluginInstallStorageSchema } from '../dashboard';
import { registerRoute, urlBuilder } from '../utils';
import { z } from '../zod';

export const VIEW_PLUGIN_UPDATE_STORAGE = 'table/{tableId}/view/{viewId}/plugin/{pluginInstallId}';
export const VIEW_PLUGIN_UPDATE_STORAGE = '/table/{tableId}/view/{viewId}/plugin/{pluginInstallId}';

export const viewPluginUpdateStorageRoSchema = z.object({
storage: pluginInstallStorageSchema.optional(),
Expand Down

0 comments on commit 163b04a

Please sign in to comment.