Commit 97b3ef0
fix(settings): prevent API key duplication on save
- Convert api_keys_text (textarea input) to api_keys array before saving
- Split text by newlines and trim each key to avoid duplicates
- Set api_keys to empty array when no keys are provided
- This fixes the issue where saving settings would duplicate API keys
because the backend expects an array, not a text string
Signed-off-by: localai-bot <localai-bot@localai.io>1 parent e0ab1a8 commit 97b3ef0
1 file changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
59 | 69 | | |
60 | 70 | | |
61 | 71 | | |
| |||
0 commit comments