Merge remote-tracking branch 'connectai/main' into feature/using-tauri-fetch

This commit is contained in:
lloydzhou
2024-09-29 23:36:17 +08:00
3 changed files with 22 additions and 9 deletions

View File

@@ -361,3 +361,15 @@ export function safeLocalStorage(): {
},
};
}
export function getOperationId(operation: {
operationId?: string;
method: string;
path: string;
}) {
// pattern '^[a-zA-Z0-9_-]+$'
return (
operation?.operationId ||
`${operation.method.toUpperCase()}${operation.path.replaceAll("/", "_")}`
);
}