fix: use authenticated requests for setup-script-url endpoint

The copy button in NodeModal was using plain fetch() instead of apiFetch() for the /api/setup-script-url endpoint, causing 401 errors when authentication is configured. Updated both PVE and PBS setup script generation to use authenticated requests.
This commit is contained in:
Pulse Monitor
2025-08-16 19:11:13 +00:00
parent f9bfdf4b17
commit 8129056eb8
@@ -485,7 +485,8 @@ export const NodeModal: Component<NodeModalProps> = (props) => {
}
// Always regenerate URL when host changes
const response = await fetch('/api/setup-script-url', {
const { apiFetch } = await import('@/utils/apiClient');
const response = await apiFetch('/api/setup-script-url', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
@@ -778,7 +779,8 @@ export const NodeModal: Component<NodeModalProps> = (props) => {
}
// Always regenerate URL when host changes
const response = await fetch('/api/setup-script-url', {
const { apiFetch } = await import('@/utils/apiClient');
const response = await apiFetch('/api/setup-script-url', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({