CenterForDigitalHumanities / CenterForDigitalHumanities/TPEN-interfaces

PUT /my/profile/update should be PUT /my/profile — wrong URL in User.js

Open
#512 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
2
Forks
3
PR merge metrics
No merged PRs in 30d

Description

## Bug Report

**Severity:** Medium
**Found during:** Pre-production stack test (2026-03-26)
**Type:** Interface/Backend API mismatch

### Description

`User.js` (~line 66) calls `PUT /my/profile/update` to update the user profile, but TPEN Services defines the route as `PUT /my/profile` (no `/update` suffix). The extra path segment causes a 404.

### Steps to Reproduce

```bash
# What Interfaces sends:
curl -X PUT \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"displayName":"test"}' \
"https://dev.api.t-pen.org/my/profile/update"
# Returns: 404

# What works:
curl -X PUT \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"displayName":"test"}' \
"https://dev.api.t-pen.org/my/profile"
# Returns: 200
```

### Expected

Profile update succeeds.

### Actual

404 — the `/update` suffix doesn't match any route.

### Fix

In `api/User.js` ~line 66, change the URL from `/my/profile/update` to `/my/profile`.

### Impact

User profile updates from the Interfaces UI will fail. The `user-profile` component's save functionality is broken.

### Related

- Backend route: `userProfile/privateProfile.js` — defines `PUT /profile` (mounted at `/my`)
- TPEN Services issue: The backend route `PUT /my/profile` works correctly (confirmed during testing)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.