mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-04-19 21:18:37 +00:00
fix: address copy functionality and code logic issues for #1828
- utils.jsx: Replace input with textarea in copy function to preserve line breaks in multi-line content, preventing formatting loss mentioned in #1828 - api.js: Fix duplicate 'group' property in buildApiPayload to resolve syntax issues - MarkdownRenderer.jsx: Refactor code text extraction using textContent for accurate copying Closes #1828 Signed-off-by: Zhaokun Zhang <zhaokunzhang@Zhaokuns-Air.lan>
This commit is contained in:
@@ -118,7 +118,6 @@ export const buildApiPayload = (
|
||||
model: inputs.model,
|
||||
group: inputs.group,
|
||||
messages: processedMessages,
|
||||
group: inputs.group,
|
||||
stream: inputs.stream,
|
||||
};
|
||||
|
||||
@@ -132,13 +131,15 @@ export const buildApiPayload = (
|
||||
seed: 'seed',
|
||||
};
|
||||
|
||||
|
||||
Object.entries(parameterMappings).forEach(([key, param]) => {
|
||||
if (
|
||||
parameterEnabled[key] &&
|
||||
inputs[param] !== undefined &&
|
||||
inputs[param] !== null
|
||||
) {
|
||||
payload[param] = inputs[param];
|
||||
const enabled = parameterEnabled[key];
|
||||
const value = inputs[param];
|
||||
const hasValue = value !== undefined && value !== null;
|
||||
|
||||
|
||||
if (enabled && hasValue) {
|
||||
payload[param] = value;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user