Fix frontend API paths to include /api/v1 prefix

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-28 00:34:38 +00:00
parent 748da6c2b4
commit 58fdcf143e
2 changed files with 6 additions and 6 deletions

View File

@@ -16,7 +16,7 @@ export default function MembersSection({ teamId }) {
const loadRoles = useCallback(async () => { const loadRoles = useCallback(async () => {
try { try {
const resp = await sw.api.get(`/teams/${teamId}/roles`); const resp = await sw.api.get(`/api/v1/teams/${teamId}/roles`);
setRoles(resp.data || ['admin', 'member']); setRoles(resp.data || ['admin', 'member']);
} catch { setRoles(['admin', 'member']); } } catch { setRoles(['admin', 'member']); }
}, [teamId]); }, [teamId]);
@@ -137,7 +137,7 @@ export default function MembersSection({ teamId }) {
if (!newRole.trim()) return; if (!newRole.trim()) return;
const updated = [...new Set([...roles, newRole.trim()])]; const updated = [...new Set([...roles, newRole.trim()])];
try { try {
await sw.api.put('/teams/' + teamId + '/roles', { roles: updated }); await sw.api.put('/api/v1/teams/' + teamId + '/roles', { roles: updated });
setRoles(updated); setRoles(updated);
setNewRole(''); setNewRole('');
sw.toast('Role added', 'success'); sw.toast('Role added', 'success');
@@ -151,7 +151,7 @@ export default function MembersSection({ teamId }) {
<button class="btn-small btn-danger" onClick=${async () => { <button class="btn-small btn-danger" onClick=${async () => {
const updated = roles.filter(x => x !== r); const updated = roles.filter(x => x !== r);
try { try {
await sw.api.put('/teams/' + teamId + '/roles', { roles: updated }); await sw.api.put('/api/v1/teams/' + teamId + '/roles', { roles: updated });
setRoles(updated); setRoles(updated);
sw.toast('Role removed', 'success'); sw.toast('Role removed', 'success');
load(); // re-check members load(); // re-check members

View File

@@ -298,7 +298,7 @@ function StageForm({ stage, teams, onSave, onCancel }) {
useEffect(() => { useEffect(() => {
if (!assignTeam) return; if (!assignTeam) return;
sw.api.get(`/teams/${assignTeam}/roles`).then(r => setTeamRoles(r.data || ['admin', 'member'])).catch(() => {}); sw.api.get(`/api/v1/teams/${assignTeam}/roles`).then(r => setTeamRoles(r.data || ['admin', 'member'])).catch(() => {});
}, [assignTeam]); }, [assignTeam]);
function submit() { function submit() {
@@ -583,7 +583,7 @@ function SignoffPanel({ instanceId, teamId }) {
const load = useCallback(async () => { const load = useCallback(async () => {
try { try {
const resp = await sw.api.get(`/instances/${instanceId}/signoffs`); const resp = await sw.api.get(`/api/v1/instances/${instanceId}/signoffs`);
setSignoffs(resp.data || []); setSignoffs(resp.data || []);
} catch { setSignoffs([]); } } catch { setSignoffs([]); }
finally { setLoading(false); } finally { setLoading(false); }
@@ -593,7 +593,7 @@ function SignoffPanel({ instanceId, teamId }) {
async function submit(decision) { async function submit(decision) {
try { try {
await sw.api.post(`/instances/${instanceId}/signoffs`, { decision, comment }); await sw.api.post(`/api/v1/instances/${instanceId}/signoffs`, { decision, comment });
sw.toast(decision === 'approve' ? 'Approved' : 'Rejected', 'success'); sw.toast(decision === 'approve' ? 'Approved' : 'Rejected', 'success');
setComment(''); setComment('');
load(); load();